Jump to content
Sign in to follow this  
Aeglon

game.py+interfacemodule

Recommended Posts

Boas, estou a ter uma guerra enorme aqui a uns dias.

 

no game.py eu tenho esta função: 

Please login or register to see this code.

 

e no file interfacemodule.py esta:

Please login or register to see this code.

 

Como é que raio, eu faço no interface module, para ir fazer a função __FazerTestes do game.py?

Share this post


Link to post
Share on other sites

Hi there! There are multiple ways to ask something from the game.py for example if you'd like to ask it from a quest you probably have a command func in your lua like:
command("HI_IM_A_COMMAND")

So you have to define this command in your game.py like:

Please login or register to see this code.

So you have to define the function of the command:

Please login or register to see this code.

In your constInfo file you have to declare the IS_IT_WORKING with the same mode

Modes for constInfo:
-the number oriental : IS_IT_WORKING = 0

-the word oriental : IS_IT_WORKING = " "

So in my case i will write

Please login or register to see this code.

After this, we have to set this into any function so this "YES" thing will be showed as a text for me right now, which looks like this:
 

Please login or register to see this code.

In your case the interfacemodule thing should be the same BUT if you'd like to set the testestest thing into a board i doN't recommand you to start with interfacemodule.py

 

I hope you can understand everything and can use something from this to help out yourself on this war! :D 
Good luck.

Edited by Ezrekith

Share this post


Link to post
Share on other sites

@Forgotten  i understand u well.

But all i need is:  to call this funcion "def _COMMAND_FUNC(self):"    but in interfacemodule..py  For what i need have to be in here.  

Share this post


Link to post
Share on other sites

Well you already set the command then so you just have to make a call on this:
 

Please login or register to see this code.

Put a space before the '='

In your constinfo you have to set this:

FazerTestesqin = 0

interfacemodule

Please login or register to see this code.

 

You can add this to the python constructor

(Which is the def __init__(self):)

Edited by Ezrekith

Share this post


Link to post
Share on other sites

@Forgotten no xD   this is not what i need.

 

in Game.py i have this:

Please login or register to see this code.

and this function ___FazerTestes(self, qid): is working very fine.  Until here, its all ok!!

 

But, i need to call this function  ___FazerTestes(self, qid):  in interfacemodule.py.  I dont know how to make it, but i know have to be something like this

interfacemodule.py

Please login or register to see this code.

Sorry for my english!

Edited by Aeglon

Share this post


Link to post
Share on other sites

You can't call the game with this:

self.game.xy

You have to call constInfo functions to get things from game.. xD

Share this post


Link to post
Share on other sites

i know i can. I have 100% sure i can XD   cuz i have it in my old server ;)    and it's a very very simple code line. But i cant remember, and i dont have my "old files" now :(

 

Share this post


Link to post
Share on other sites
Please login or register to see this quote.

tenta fazer :

 

from game import function_do_game

 

dps usas a tua função

 

def funcaodointra():

         function_do_game(5,5,59)

  • Upvote 1

Share this post


Link to post
Share on other sites

ainda não funciona, mas já deu para avançar mais qualquer coisa.... mas ainda não dá xD

Obrigado na mesma.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.
You will be able to see content when you disable your adblocker and enable javascript.