ConvertHumantoHybridEventsUnit-AnyUnittakesFatalAnydamage(fromAnyeffects)LocalVariablesConditions(Unittypeof(Triggeringunit))==Human(Builder)((Triggeringplayer)isinHumans)==true((Triggeringplayer)isinHybrids)==trueActionsUI-Display((Text(Nameofplayer(Triggeringplayer))withcolor(Color((Currentplayer(Triggeringplayer)color))))+(" has been killed by "+((Text(Nameofplayer(Damagingplayer))withcolor(Color((Currentplayer(Damagingplayer)color))))+andwillnofor(Allplayers)toDebugareaUnitGroup-Pickeachunitin(Anyunitsin(Entiremap)ownedbyplayer(Triggeringplayer)matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsUnit-Remove(Pickedunit)fromthegamePlayerGroup-Removeplayer(Triggeringplayer)fromHumansPlayerGroup-Addplayer(Triggeringplayer)toHybridsUnit-Set(Damagingunit)Experienceto(((Damagingunit)Experience(Current))+((+((Real(hybHeroLevel[(Damagingplayer)])),(Real(1))))*(Real(100))))Player-Modifyplayer(Damagingplayer)Minerals:Add100Player-Modifyplayer(Damagingplayer)Vespene:Add5Player-Modifyplayer(Triggeringplayer)Minerals:Subtract1000000000Player-Modifyplayer(Triggeringplayer)Vespene:Subtract1000000000Player-Modifyplayer(Triggeringplayer)Minerals:Add(1*(Integer((Round((MissionTime))))))General-If(Conditions)thendo(Actions)elsedo(Actions)If(MissionTime)>=900.0ThenPlayer-Modifyplayer(Triggeringplayer)Vespene:Add5ElseGeneral-Wait2.0RealTimesecondsCamera-Panthecameraforplayer(Triggeringplayer)to(CenterofHybridSpawn)over0.0secondswith100%initialvelocity,0%deceleration,andDoNotusesmartpanningUnit-Create1Hybridforplayer(Triggeringplayer)at(CenterofHybridSpawn)usingdefaultfacing(NoOptions)Environment-ExecuteLevelUpEffectTriggeron(Lastcreatedunit)fromplayer0UI-DisplayYouhaverespawnedasaLesserHybr...for(Playergroup((Triggeringplayer)))toDebugarea
This trigger works fine, up until the "camera - pan" action and beyond, where it gives me an error ingame saying that triggering player is returning -1. I've tried using Owner of Unit(Triggering Unit) and it returns 16, which is an impossible value because you can only have a maximum of 15 players in the game. How do I fix this??
Hmm I heard of a problem where triggers "forget" the value for triggering player. However I never encoutered it myself. Try storing triggering player in an integer variable and see if it works...
Well, If you remove a unit, then refer it it, I expect some technical difficulties will occur. Basically, Remove (Triggering Unit) at the end of the trigger, as I imagine (Triggering Unit) would be Picked in that loop, and removed, and once it is removed, well, It tends to not belong to any player.
Also, Triggering Player, I wouldn't expect to work, as the trigger does not have anything to do with a player.
Hmm I heard of a problem where triggers "forget" the value for triggering player. However I never encoutered it myself. Try storing triggering player in an integer variable and see if it works...
I tried setting a variable to triggering player just before the camera - pan action, it still didn't return the correct value. :/
Well, If you remove a unit, then refer it it, I expect some technical difficulties will occur. Basically, Remove (Triggering Unit) at the end of the trigger, as I imagine (Triggering Unit) would be Picked in that loop, and removed, and once it is removed, well, It tends to not belong to any player.
Also, Triggering Player, I wouldn't expect to work, as the trigger does not have anything to do with a player.
It might be the removal of the unit that's causing this, maybe. I'll try moving the remove units action down after the camera - pan action.
BTW it counts "Triggering Player" as the owner of the triggering unit, according to the hint text associated with this event. And likewise with damaging player etc. I was using owner of unit (triggering unit) before I switched to triggering player and it worked up until the same point.
Edit: Nope, moving the remove action to the end of the trigger doesn't fix it.
I tried setting a variable to triggering player just before the camera - pan action, it still didn't return the correct value. :/
That should be the first action in the trigger... xD
Basicly you changed nothing because you stored it at a point where you already lost the value.
I guess it's as Ranakastrasz sad, the removal of the unit also removes the link the the Triggering Player.
That should be the first action in the trigger... xD Basicly you changed nothing because you stored it at a point where you already lost the value. I guess it's as Ranakastrasz sad, the removal of the unit also removes the link the the Triggering Player.
I guess I should have thought to put the set variable at the beginning of the trigger. Now it works lol. The remove unit action doesnt have anything to do with it. Thanks :D
okay look at this:
This trigger works fine, up until the "camera - pan" action and beyond, where it gives me an error ingame saying that triggering player is returning -1. I've tried using Owner of Unit(Triggering Unit) and it returns 16, which is an impossible value because you can only have a maximum of 15 players in the game. How do I fix this??
Hmm I heard of a problem where triggers "forget" the value for triggering player. However I never encoutered it myself. Try storing triggering player in an integer variable and see if it works...
Well, If you remove a unit, then refer it it, I expect some technical difficulties will occur. Basically, Remove (Triggering Unit) at the end of the trigger, as I imagine (Triggering Unit) would be Picked in that loop, and removed, and once it is removed, well, It tends to not belong to any player.
Also, Triggering Player, I wouldn't expect to work, as the trigger does not have anything to do with a player.
I tried setting a variable to triggering player just before the camera - pan action, it still didn't return the correct value. :/
It might be the removal of the unit that's causing this, maybe. I'll try moving the remove units action down after the camera - pan action.
BTW it counts "Triggering Player" as the owner of the triggering unit, according to the hint text associated with this event. And likewise with damaging player etc. I was using owner of unit (triggering unit) before I switched to triggering player and it worked up until the same point.
Edit: Nope, moving the remove action to the end of the trigger doesn't fix it.
That should be the first action in the trigger... xD Basicly you changed nothing because you stored it at a point where you already lost the value. I guess it's as Ranakastrasz sad, the removal of the unit also removes the link the the Triggering Player.
I guess I should have thought to put the set variable at the beginning of the trigger. Now it works lol. The remove unit action doesnt have anything to do with it. Thanks :D
the wait 2.0 is the reason. the unit is removed in automatically if it dies, there is no need to do it yourself
From what I know, the trigger can "forget" triggering player. So make the first action
And then reference the trig_player variable. That always fixes the problem for me.