Author Topic: How do i display VCE values in a GUI?  (Read 546 times)

I'm pretty sure DRPG did this. (Assuming they used VCE)

But here what i need.

I click a tree 7 times it gives me 3 Lumberjack EXP and 2 Logs (Variable names: woodXP, Nwood) using VCE. (Both on client)

Then i use my keybind (CTRL+Q) and my GUI pops up.

How do i get the amount of wood i have (gotten via VCE events) to be displayed in the GUI?

*I click the brick and get 10 "wood"
*I open my GUI
*On the side it says Wood: (BLANK?!?!)  (This is the problem! I my number of wood displayed!)

-Additional things-
If i don't have any wood could i make it say 0 or N/A instead of a blank?

---------------------
Please improvise and help. Thank you.

The variable is stored on the server, you need to send it to the client.
The way I do that:

In the function that your bind calls to open the gui, add a commandtoserver call.
Create the corresponding serverCmd, in which you call a commandtoclient, with the amount of wood as an argument
Create the corresponding clientCmd, in which you set a GuiTextCtrl's text (the function is either setText or setValue) to the recieved argument

sample code:

client:
Code: [Select]
function <guiBindFunction>
{
//Your current code
commandtoserver('RPG_GetData');
}

function clientCmdRPG_SetData(%wood)
{
RpgWoodText.setText(%wood);
}

server:
Code: [Select]
function serverCmdRPG_GetData(%client)
{
commandtoclient(%client,%wood);
}

You'd have to replace %wood in the serverCmd with the proper VCE variable call

(Assuming they used VCE)
It didn't. IMO integrating scripts and events (especially VCE) is a pain and doing everything script is easier (except for a very few things that have to use events)
« Last Edit: October 07, 2012, 11:26:23 PM by Headcrab Zombie »