EDITED TYPO--
I have a "gold" system and a "health" system to add/subtract player's gold and health.
Methods are defined in game.script up at the very top:
global MoneyAmount = 0;
method AddMoney(AddAmount)
{
if(MoneyAmount==null) MoneyAmount = 0;
if(AddAmount==null) AddAmount = 0;
MoneyAmount = MoneyAmount + AddAmount;
}
global HealthAmount ="";
method SubtractHealth(SubtractAmount)
{
if(HealthAmount==null) HealthAmount = 100;
if(SubtractAmount==null) SubtractAmount = 0;
HealthAmount = HealthAmount - SubtractAmount;
}
-----
On a window in a scene, I have script:
#include "scripts\base.inc"
var touched = 0;
on "LeftClick"
{
if (touched==0)
{Game.
Msg("It is a dirty window but you find some gold.");
touched = 1;
}
else
{
if (touched==1)
{Game.
Msg("It is just a dirty window.");
}
}
}
On a vase in same scene I have script:
#include "scripts\base.inc"
var bite = 0;
on "LeftClick"
{
if (bite==0)
{Game.
Msg("Exploring the vase, you feel a sharp pain in your hand as a scorpion bites you and scuttles out of the vase.");
bite = 1;
}
else
{
if (bite==1)
}
}
}
It doesn't work as it should.
The display in the text box in the window starts out 0 for the gold and 100 for the health, which is fine.
If I click on the window, the gold amount changes to 5.
If I click on the vase, the health decreases by 5 to 95 which is fine BUT THE GOLD GOES BACK TO 0.
If I reload the scene to start over--
Same thing if I click on the vase first, the health decreases by 5 to 95.
Then if I click on the window, the gold increases by 5 to 5 BUT the health goes back to 100.
I think I'm passing [null] here at some point somehow when I shouldn't be.
My spirits are down because I woefully have to redo my dialogue box using the regular response system, so any help would cheer me up.