Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

Hello everyone,

In this tutorial, I'll guide you on setting up communication between quests and the client interface. While there are modern game sources available, some might prefer this reliable older approach. Let's get started!

Sending Information to the Client

To initiate communication from the quest, you can use a simple command that's familiar to most developers.

 
This is the hidden content, please

On the client side, you will need to update game.py:

Locate the following section:

 
This is the hidden content, please

Under this section, add:

 
This is the hidden content, please

Next, define the function in Python named command_name_python or the name you used:

spacer.png

 
This is the hidden content, please

Make sure all functions and text are properly aligned with TAB key spaces.

Starting a Quest from the Client (for Button Presses)

The quest structure can be set up like this:

 
This is the hidden content, please

For the client, add to game.py under the same section:

 
This is the hidden content, please

Then, define the function as follows:

 
This is the hidden content, please

Before continuing, don't forget to open constInfo.py and add:

 
This is the hidden content, please

You can now utilize this function throughout your Python code:

 
This is the hidden content, please

This method is particularly useful for button actions. Be cautious not to trigger this function from within a quest to avoid creating infinite loops.

Retrieving a Variable from the Client (For Updates 34 & 40k)

This trick is essential and requires careful attention to detail. Your quest should look like this:

 
This is the hidden content, please

On the client-side, make the following additions to game.py:

 
This is the hidden content, please

Next, define these constants in constInfo:

 
This is the hidden content, please

Now, modify interfacemodule.py for versions 34k and above:

 
This is the hidden content, please

For lower versions, open uiquest.py and add the check:

 
This is the hidden content, please

Finally, implement these functions in game.py:

 
This is the hidden content, please

Ensure that the last line of your Python files is left blank.

Sending Multiple Information to the Client at Once

To send several values at once, use the following method:

 
This is the hidden content, please

In the client, process the received variables like this:

 
This is the hidden content, please

By following these steps, you can successfully set up communication between quests and the client. Enjoy enhancing your game's functionality!

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...