right now i am working on my spawn and respawnsystem. atm -> each player can select 1 of X units to play with. the dialogbuttons and so on worked fine. when a player choose a unit, i store it on a global unit group. (1 Unitgroup for each player)
Now i want a respawn for this units in my base. It worked pretty easy with -> event: any unit dies - con: unit = unitgroup player1 - action: create 1 unit of unit typ of unit 1 from unitgroup player1.
My Problem now is, i want the gained experiance and levels to stay on the unit. I am not sure, but i think i need to add this global unitgroup to a global unit. I did this in a global "unit" variable and linked it to the unit group, but not managed to get this "unit" variable in my action in the event.
I really need help here, my english is way to bad to handle this. working on it like 2h. :/ please help
1.) Set the Death duration of the unit greater than the duration between the death and the respawn of the unit. If you make a respawn after 30 seconds, set the Death duration to 31 for instance.
2.) Use the non-integrated-into-GUI function named "UnitRevive()". Add a custom code action and tape "UnitRevive(lv_unit);" as lv_unit is the local variable "unit".
I cant find a custom code action. Looked all actions, not found it. There was a "custom script" but could not type in there. Can you please tell me exactly where i can find this custom code action? thanks! :)
I cant find a custom code action. Looked all actions, not found it. There was a "custom script" but could not type in there. Can you please tell me exactly where i can find this custom code action? thanks! :)
This is the "Custom script" action. Add the "Custom script" action and click on it. The bottom place of the trigger window will be a text editor then you can tape "UnitRevive()" as i say :)
EDIT : SORRY, the last editor version has the action "Revive Unit" in the GUI. Useless to bypass with custom script :)
Hi there,
right now i am working on my spawn and respawnsystem. atm -> each player can select 1 of X units to play with. the dialogbuttons and so on worked fine. when a player choose a unit, i store it on a global unit group. (1 Unitgroup for each player)
Now i want a respawn for this units in my base. It worked pretty easy with -> event: any unit dies - con: unit = unitgroup player1 - action: create 1 unit of unit typ of unit 1 from unitgroup player1.
My Problem now is, i want the gained experiance and levels to stay on the unit. I am not sure, but i think i need to add this global unitgroup to a global unit. I did this in a global "unit" variable and linked it to the unit group, but not managed to get this "unit" variable in my action in the event.
I really need help here, my english is way to bad to handle this. working on it like 2h. :/ please help
Noone? :o(
@Tarbald: Go
You can use the Revive function. For that :
1.) Set the Death duration of the unit greater than the duration between the death and the respawn of the unit. If you make a respawn after 30 seconds, set the Death duration to 31 for instance.
2.) Use the non-integrated-into-GUI function named "UnitRevive()". Add a custom code action and tape "UnitRevive(lv_unit);" as lv_unit is the local variable "unit".
I cant find a custom code action. Looked all actions, not found it. There was a "custom script" but could not type in there. Can you please tell me exactly where i can find this custom code action? thanks! :)
This is the "Custom script" action. Add the "Custom script" action and click on it. The bottom place of the trigger window will be a text editor then you can tape "UnitRevive()" as i say :)
EDIT : SORRY, the last editor version has the action "Revive Unit" in the GUI. Useless to bypass with custom script :)