[Solved] Reseting score in multiboard

Status
Not open for further replies.
Level 4
Joined
Dec 5, 2011
Messages
75
Hi guys im having troubles making a trigger to reset a score
i got a multiboard that set exp for every killed unit but i need the XP reset to 0 after it is greater or equal to 100 like this :
(exp is integer variable not exp from the game)

XP ->killed unit gives +20 exp -> XP
80 ----------------------------> 0

or

XP ->killed unit gives +40 exp -> XP
88 ------------------------------>0

i tried:
if XP(variable) greater or equal to 100
multiboard set the text ...XP...to 0

but it only reset after the next XP i get after 100 and it stays static to 0,doenst go up anymore:

XP --> killed unit gives +20exp ->XP -> killed unit gives +20 exp-> XP
80 ---------------------------->120 ---------------------------->0(static)

help please!
 
I advise decoupling the multiboard system from the exp system for better cohesion.

Anyway the behaviour you explain is because your script makes no sense.

Here is pesudo code for what the system should do.

ENTRY when unit should gain EXP
1. Raise EXP by earned amount
2. If EXP greater than 100
2.true.1. LEVEL UP!!! (or whatever you want to happen at 100 exp)
2.true.2. set EXP to 0
3. Update display value for experience to EXP

key features of this script structure
* Centeral place where EXP is added
* Range restriction on EXP is enforced after every change
* Only 1 place of coupling with the experience display procedure

Maker, your method is less efficient than my described pesudocode as you perform addition twice in most cases where it only is needed once.
 
hi dr super good the way you explained worked!! the problem was setting the XP variable to 0
can admin put this thread solved? thanks!!
 
Status
Not open for further replies.
Back
Top