Is the array big enough for it to fit the value of triggering player there? And have you defined the unit type before, since you need to do that before that trigger in order it to work.
example.
create variable. Units[15] = no units
Map init -> Set variable Units[1] = marine, Set variable Units[2] = marauder
it should work if you do it like that...
OH AND JUST NOTCED. Why are you using triggering unit things there. THERE IS NO TRIGGERING UNIT if you use dialog item!
The array is [15] and testing it I'm Local Player which I assume is player 1. The unit type is defined within the trigger as being a marine before creating the unit aswell.
Testing out a simple trigger I rigged up without all the sdkljasklh of my other trigger. It worked in creating a unit on map initialization. I'm on the right track, I'll post if I get it.
Edit: I got it working, I'm not sure what was wrong with it but none the less it works now. Thanks for the help anyways!
Edit: I got it working, I'm not sure what was wrong with it but none the less it works now. Thanks for the help anyways!
When you order a unit to be created for player X through a variable, if the variable array [x] has no unit type defined (like the default "no unit" value, or a unit that is now dead), it gives an error because it means there is no type of unit to spawn for this player. In your case you set the unit type for player 1, but since it checks for EVERY player from 0 to 15, if there is a "no unit" somewhere in the array it will display an error. It's pure logic, he can't spawn a unit of type "no unit type" for player 0, because there isn't any. It would be a paradox.
Let's say I already set Unit Type[Triggering Player] = Marine
If (Used dialog item) == Buttons[12]
Then
Unit - Create 1 Unit Type[(Triggering player)] for player (Triggering player) at Command post 1 facing (Position of (Triggering unit)) (No Options)
^Why would doing something like this give me an error of this:
"Trigger Error in 'gt_HeroSelection_Function': Could not get 'Unit type' from parameter in 'sUnitCreate' [Value: 0]"
When using an action such as this would be doing the exact same thing except without using a unit type variable.
Unit - Create 1 Marine for player (Triggering player) at Command post 1 facing (Position of (Triggering unit)) (No Options)
My problem comes from the fact that I need to use a unit type variable, I can't just select which unit is to be created.
You propably havent set the variable right.
Is the array big enough for it to fit the value of triggering player there? And have you defined the unit type before, since you need to do that before that trigger in order it to work.
example.
create variable. Units[15] = no units
Map init -> Set variable Units[1] = marine, Set variable Units[2] = marauder
it should work if you do it like that...
OH AND JUST NOTCED. Why are you using triggering unit things there. THERE IS NO TRIGGERING UNIT if you use dialog item!
The array is [15] and testing it I'm Local Player which I assume is player 1. The unit type is defined within the trigger as being a marine before creating the unit aswell.
Testing out a simple trigger I rigged up without all the sdkljasklh of my other trigger. It worked in creating a unit on map initialization. I'm on the right track, I'll post if I get it.
Edit: I got it working, I'm not sure what was wrong with it but none the less it works now. Thanks for the help anyways!
When you order a unit to be created for player X through a variable, if the variable array [x] has no unit type defined (like the default "no unit" value, or a unit that is now dead), it gives an error because it means there is no type of unit to spawn for this player. In your case you set the unit type for player 1, but since it checks for EVERY player from 0 to 15, if there is a "no unit" somewhere in the array it will display an error. It's pure logic, he can't spawn a unit of type "no unit type" for player 0, because there isn't any. It would be a paradox.