Right now when my game starts up a "select difficulty" dialog pops up and allows the players to select their difficulty. I've done the triggering for choosing the average of every difficulty selected and storing that as a global "real" variable which is called "HP difficulty multiplyer"
Here is what I'm trying to accomplish. Each unit that is created for each new wave have his hitpoints adjusted by taking the base of that units hitpoints and multiplying it by the "HP difficulty multiplyer. Here is what I have so far, but I'm not getting any results.
There are 3 different groups of monsters that spawn each wave (hence the 3 actions dealing with "Create spawn amount 1,2,3[current wave]..." My tower defense setup spawns bulk units at a time not 1 at a time (the game mechanic works to my like with grouped enemies rather than spitting one unit out at a time).
The Unit - Set (Created unit) Maximum Life to (((Created unit) Life (Current)) * HP Difficulty Multiplier)
Unit - Set (Created unit) Life to (((Created unit) Life (Current)) * HP Difficulty Multiplier)
is where I'm having the trouble. It would seem that I have something mixed up somewhere since the HP of the units is not changing. (Side question: is using "created unit" a bad idea since I created 3 different monster bulks at the same time? I would hate to have the Hitpoints swapped. Any help would b e much appreciated thank you.
If you're creating more than one unit, then I don't think the Created Unit function works well. There should be a Last Created Units function that returns a Unit Group. Then, you pick each unit from that group and perform your multiplications.
Also, make sure you do this immediately after each unit creation because the Last Created Units change to be those that were created in the last Create Units call.
Well,first of all Created unit is the wrong variable.
Created unit can only be used when you have the even "Unit is created".
What you are searching for is Last Created Unit.
However, everytime you create a new unit, Last Created Unit will be changed. So if you want to do it that way you have to add the change-life action behind every spawn action.
Also, Last Created Unit only returns the one last unit that was created. Only one. So if Wave Spawn Amount is more than 1, you cannot use it, because only the last of these units would get their hp changed.
Instead you need to use a unit group:
However, Last Created Units will also only keep all the units created by the last Create Unit action. When you run Create Unit again, it will change. So you will still have to add the change-life actions (with that I mean this unit group loop) after every Create Unit.
When you change these things it might already work^^
Quick followup question for you. When I go to setup the Unit Group - For each unit unit in (Last created units) do (Actions), the trigger is automatically disabled and when I try to re-enable it, it says "Parameter value has not been set (Unit)" When I click on unit to set the perameter there is nothing to choose from...What am I supposed to do?
Quick followup question for you. When I go to setup the Unit Group - For each unit unit in (Last created units) do (Actions), the trigger is automatically disabled and when I try to re-enable it, it says "Parameter value has not been set (Unit)" When I click on unit to set the perameter there is nothing to choose from...What am I supposed to do?
You want the action named "Pick Each Unit From Unit Group" not the "For Each Unit In Unit Group" action.
Right now when my game starts up a "select difficulty" dialog pops up and allows the players to select their difficulty. I've done the triggering for choosing the average of every difficulty selected and storing that as a global "real" variable which is called "HP difficulty multiplyer"
Here is what I'm trying to accomplish. Each unit that is created for each new wave have his hitpoints adjusted by taking the base of that units hitpoints and multiplying it by the "HP difficulty multiplyer. Here is what I have so far, but I'm not getting any results.
There are 3 different groups of monsters that spawn each wave (hence the 3 actions dealing with "Create spawn amount 1,2,3[current wave]..." My tower defense setup spawns bulk units at a time not 1 at a time (the game mechanic works to my like with grouped enemies rather than spitting one unit out at a time).
The Unit - Set (Created unit) Maximum Life to (((Created unit) Life (Current)) * HP Difficulty Multiplier) Unit - Set (Created unit) Life to (((Created unit) Life (Current)) * HP Difficulty Multiplier)
is where I'm having the trouble. It would seem that I have something mixed up somewhere since the HP of the units is not changing. (Side question: is using "created unit" a bad idea since I created 3 different monster bulks at the same time? I would hate to have the Hitpoints swapped. Any help would b e much appreciated thank you.
If you're creating more than one unit, then I don't think the Created Unit function works well. There should be a Last Created Units function that returns a Unit Group. Then, you pick each unit from that group and perform your multiplications.
Also, make sure you do this immediately after each unit creation because the Last Created Units change to be those that were created in the last Create Units call.
Well,first of all Created unit is the wrong variable.
Created unit can only be used when you have the even "Unit is created".
What you are searching for is Last Created Unit.
However, everytime you create a new unit, Last Created Unit will be changed. So if you want to do it that way you have to add the change-life action behind every spawn action.
Also, Last Created Unit only returns the one last unit that was created. Only one. So if Wave Spawn Amount is more than 1, you cannot use it, because only the last of these units would get their hp changed.
Instead you need to use a unit group:
However, Last Created Units will also only keep all the units created by the last Create Unit action. When you run Create Unit again, it will change. So you will still have to add the change-life actions (with that I mean this unit group loop) after every Create Unit.
When you change these things it might already work^^
@s3rius: Go
Quick followup question for you. When I go to setup the Unit Group - For each unit unit in (Last created units) do (Actions), the trigger is automatically disabled and when I try to re-enable it, it says "Parameter value has not been set (Unit)" When I click on unit to set the perameter there is nothing to choose from...What am I supposed to do?
You want the action named "Pick Each Unit From Unit Group" not the "For Each Unit In Unit Group" action.
@Klishu: Go
IT WORKS HURRAY! Thank you Klishu