Game Development Community

Resources in World Domination Mod...

by Andrew Brezina · in RTS Starter Kit · 04/07/2008 (8:08 pm) · 3 replies

I see where the resources are updated in the mod, but where is the command where the resources actually get displayed in the GUI? I was looking in resources-client.cs but can't seem to find where this exists.

#1
04/07/2008 (9:34 pm)
Actually is exactly on that file:
function resourceStore::UpdateGui(%clientSupply)
{ 
	
  if(!IsObject(%clientSupply.gui)) 
    return; 
[b]  %gui = %clientSupply.gui; 
  %gui.SetValue(%clientSupply.count);[/b]
#2
04/08/2008 (5:13 am)
I thought so! And this calls a clientSupply.gui correct? Which would explain why it is not working because I do not have a clientSupply.gui...

Since I do not, the if statement:

if(!IsObject(%clientSupply.gui))
return;

fails and returns past the code and never updates the supply?
#3
04/08/2008 (6:32 am)
Well that depends on what you are doing (how, when, and why you are calling the function), and honestly I couldnt say more given the current info.

Anyway, you have to call the function with a proper %clientsupply (look in function resourceStore::Ctor() to see what it is), if you dont, then there is no point on calling resourceStore::UpdateGui

Its really important that you understand what is happening there before trying to make changes, otherwise is useless.

And another thing thats really important is to have at least a basic knowledge of programming. The last time I mentioned this, another member got angry, but lets be honest on this: if people start asking questions but dont have the skills to ask properly, nor to understand the answers, then there is really no point on that- You have to be able to read and understand the majors parts of the code, until that moment, focus yourself on learn coding.