I have a dialog set up so when a button is pressed a unit spawns, i would like for the unit spawned to have their initial exp value be set to a specific number that will normally come from the bank of the player. how ever even when i have the variable that i use for this have an initial value it doesnt apply the exp to the unit.
The trigger (which "should" work) looks like this
Set (last created unit) (property: experience) to (variable Exp[triggering player]) Sidenote: when i have the variable set to be EXP[1] or any other number it still doesnt work.
EXP is a real not an integer. also setting EXP's value to a unit's exp works completely fine.
Update: setting a unit's exp to a predetermined number works fine (i.e set unit exp to 100) however setting it to a variable does not.
Does anyone know anyway to set a unit's exp to a variable?
I think that your problem may be either that you're using the wrong type of variable, or potentially your variable isn't actually not 0. Try manually setting a Real variable to 15, and test if it works then. Otherwise I'll check it out when I get a chance. You might need to use an integer variable, but like I said, try testing it a bit.
problem is i can do the exact opposite, so im definitely using the right variable, a real. ive gone through and set the real to start at 75 and it did nothing ive tried using integers as well so im completely at a loss.
I never had problems setting a unit's exp by variables. Could you show some of your code? (This one works perfect for me, so I don't see why passing a variable shouldn't work:
in the trigger.
Dialog hit-
1. spawn unit
2.set unit to unit group
3. exp trigger.
Like i said it works when its set to a value that cant be changed like a variable.
as soon as map load finishes banks are opened, assigned to a bank variable and the real value loaded from them.
I also have tested this, and can confirm that setting some unit's Experience to anything, even explicitly setting the experience to "15" doesn't work. Some units, I think, don't have the ability to have experience. I believe the problem lies in the data editor somewhere.
Using a test unit Marine, I tried setting the Experience property of the unit (via Set Unit Property - Experience "15", and also tried looping a Modify Unit effect that adds 1 experience 15 times. The output of the Unit's Property afterward was still "0". There must be a Data property somewhere that either enables experience, or changes the maximum experience of a Unit to greater than 0.
Any experts out there?
PS: I've read somewhere about a Behavior named "Veterancy", but the editor does not have such a behavior. I believe if you add this behavior to a unit, it will allow it to start gaining experience, but searching through the Data editor I couldn't find it. It may have been a problem that I only used Wings of Liberty as my only dependency, and maybe if I added Heart Of the Swarm in there as well, I would have the Behavior in my data editor...
when you create a behavior one of the types (buff, attribute, powersource. all behavior types) is veterancy. Name ID Behavior type (in order from top to bottom) and then clicking the dropdown menu veteraqncy is 2nd to last on the list.
Upadte: i found the root of the problem, apparently (set variable) real:Set to (load real value from bank) set the value to 0
BUT (modify real) real: add (load value form bank) sets it like it should be set. WTF
I have a dialog set up so when a button is pressed a unit spawns, i would like for the unit spawned to have their initial exp value be set to a specific number that will normally come from the bank of the player. how ever even when i have the variable that i use for this have an initial value it doesnt apply the exp to the unit. The trigger (which "should" work) looks like this Set (last created unit) (property: experience) to (variable Exp[triggering player]) Sidenote: when i have the variable set to be EXP[1] or any other number it still doesnt work. EXP is a real not an integer. also setting EXP's value to a unit's exp works completely fine.
Update: setting a unit's exp to a predetermined number works fine (i.e set unit exp to 100) however setting it to a variable does not. Does anyone know anyway to set a unit's exp to a variable?
I think that your problem may be either that you're using the wrong type of variable, or potentially your variable isn't actually not 0. Try manually setting a Real variable to 15, and test if it works then. Otherwise I'll check it out when I get a chance. You might need to use an integer variable, but like I said, try testing it a bit.
@gerudobombshell: Go
problem is i can do the exact opposite, so im definitely using the right variable, a real. ive gone through and set the real to start at 75 and it did nothing ive tried using integers as well so im completely at a loss.
I never had problems setting a unit's exp by variables. Could you show some of your code?
(This one works perfect for me, so I don't see why passing a variable shouldn't work:
)
@Talon0815: Go
my code is Set unit property: (last created unit)* (experience) to (EXP[triggering player])**
do you create the unit in the trigger? prior to this function? what code is used to set the variable?
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
@willuwontu: Go
in the trigger. Dialog hit- 1. spawn unit 2.set unit to unit group 3. exp trigger. Like i said it works when its set to a value that cant be changed like a variable.
as soon as map load finishes banks are opened, assigned to a bank variable and the real value loaded from them.
Add a debug message after "set unit property" and print the content of "EXP[triggering player]". If that shows a value != 0 I have no idea...
I also have tested this, and can confirm that setting some unit's Experience to anything, even explicitly setting the experience to "15" doesn't work. Some units, I think, don't have the ability to have experience. I believe the problem lies in the data editor somewhere.
Using a test unit Marine, I tried setting the Experience property of the unit (via Set Unit Property - Experience "15", and also tried looping a Modify Unit effect that adds 1 experience 15 times. The output of the Unit's Property afterward was still "0". There must be a Data property somewhere that either enables experience, or changes the maximum experience of a Unit to greater than 0.
Any experts out there?
PS: I've read somewhere about a Behavior named "Veterancy", but the editor does not have such a behavior. I believe if you add this behavior to a unit, it will allow it to start gaining experience, but searching through the Data editor I couldn't find it. It may have been a problem that I only used Wings of Liberty as my only dependency, and maybe if I added Heart Of the Swarm in there as well, I would have the Behavior in my data editor...
@gerudobombshell: Go
when you create a behavior one of the types (buff, attribute, powersource. all behavior types) is veterancy. Name ID Behavior type (in order from top to bottom) and then clicking the dropdown menu veteraqncy is 2nd to last on the list.
Upadte: i found the root of the problem, apparently (set variable) real:Set to (load real value from bank) set the value to 0 BUT (modify real) real: add (load value form bank) sets it like it should be set. WTF