I'm using this injunction with some dialogs for a character gender and class selection. The code is half of the on click function of the class button. What I want to happen is that you click your class and it checks your gender and gives you the appropriate class and gender character in a selection "screen". I also want the user to be able to change his/her mind. I would like the user to be able to click a different class and it also give the user the appropriate class and gender combo. All of this works however the minor detail of replacing the prior chosen unit with the new choice does not and I end up with a pile of selected units. I want there to only be one unit displayed while the user chooses his/her class.
I have tried in the remove unit's action place replace unit and rather than using the stored Temp_Unit variable that I created to store the unit last made, I have used the Last Created Unit function to no avail. Perhaps there is a better way to do this or maybe a better function that I don't know about since I only started mapping recently. Please help me make this work.
TLDR
This "code" block doesn't seem to remove the prior results of its use. I need to be able to remove a recently spawned unit.
Hi, I'm kinda new here so hopefully this isn't too noob of a problem. First and foremost here is the code block I'm having trouble with.
IMAGE OF THE TRIGGER EDITOR
I'm using this injunction with some dialogs for a character gender and class selection. The code is half of the on click function of the class button. What I want to happen is that you click your class and it checks your gender and gives you the appropriate class and gender character in a selection "screen". I also want the user to be able to change his/her mind. I would like the user to be able to click a different class and it also give the user the appropriate class and gender combo. All of this works however the minor detail of replacing the prior chosen unit with the new choice does not and I end up with a pile of selected units. I want there to only be one unit displayed while the user chooses his/her class.
I have tried in the remove unit's action place replace unit and rather than using the stored Temp_Unit variable that I created to store the unit last made, I have used the Last Created Unit function to no avail. Perhaps there is a better way to do this or maybe a better function that I don't know about since I only started mapping recently. Please help me make this work.
TLDR This "code" block doesn't seem to remove the prior results of its use. I need to be able to remove a recently spawned unit.
As far as I can see the variable Unit Present can never be true, so 'Unit - Remove Temp Unit from the game' never run.
Make Unit Present a global array and set it to true for the index of triggering player whenever he chooses a unit.
Alternatively, you can check if Temp Unit is a valid unit, basically checking if the unit exists or not.
@Builder_Bob: Go
Thanks So Much!
I can't believe I missed that! It was so obvious. Sorry for my nubbery, but thank you again!