@zandose: Go
Could not find " Heght of UnittoFollow" and again i need this to go off for all 8 players without 8 separate triggers..
"Heght of (some unit)" is a function
"UnittoFollow" is simple a variable containing the unit.
As for one script for all players:
UntitledTrigger001EventsTimer-Elapsedtimeis1.0GameTimesecondsLocalVariablesVariable.Units=NoUnit<Unit[8]>ConditionsActions------- You need to assign the players unit to the variableVariable-SetVariable.Units[1]=Marine[104.00,148.21]------- PlayerGroup-Pickeachplayerin(ActivePlayers)anddo(Actions)ActionsCamera-ApplycameraobjectHeightOffset((HeightofVariable.Units[(Pickedplayer)])+1.0)forplayer(Pickedplayer)over0.0secondswithExistingVelocity%initialvelocityand10.0%deceleration
I guess the wording can be a bit confusing. The variable will simply hold which player the loop is currently running for, it's just letting you pick which variable you want to use instead of doing it itself. Make a local integer variable and use that for the "player variable".
Also its just like the trigger under it called "Pick each player in (player group) and do actions", except in this case the trigger itself will provide the variable. So instead of using a local variable for the player you'd use the function "picked player".
Yes and no. While loops, if not properly made or the unexpected happens, can run on forever crashing the game. So I don't use them often. If it works for you it works. I believe FoxyMayhem said there was a chance of their being a fourth column, so it's uncertain if he'd need the for-lopp to run 3 or 4 times. and therefore a while-loop wouldn't probably be a good option as long as safety's were added.
As for the for-loop not working, you probably missed something as for-loops can do anything while-loops can, you just need to change the code a bit. You just need to debug it to hell.
@Kueken531: Go:) That's basically what I did. Recreated the framework trigger, debugged the hell out of it, and found dead units getting referenced again.
I've done some testing and I've found perhaps one problem. In your repeat/switch-case part of the trigger, killing a unit does not remove it from the unitgroup, in which case the trigger may be reusing an already dead unit (closet unit to point). To fix it, create another unitgroup variable, copy the original unitgroup to the new variable, and use this new variable instead for the repeat/switch part, and after you kill the unit add a trigger to remove the unit from the new variable.
See if this solves the problem, otherwise I'll have to keep looking.
Have you thought about player groups for this task?
UntitledTrigger001Events------- Deisgned for only two teams.Timer-Elapsedtimeis0.1GameTimesecondsLocalVariablesGroup.Team1=(Emptyplayergroup)<PlayerGroup>Group.Team2=(Emptyplayergroup)<PlayerGroup>WhichTeamToAssignTo=False<Boolean>ConditionsActionsPlayerGroup-Pickeachplayerin(ActivePlayers)anddo(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfWhichTeamToAssignTo==TrueThenPlayerGroup-Addplayer(Pickedplayer)toGroup.Team1Variable-SetWhichTeamToAssignTo=FalseElsePlayerGroup-Addplayer(Pickedplayer)toGroup.Team2Variable-SetWhichTeamToAssignTo=TruePlayer-MakeallplayersinGroup.Team1treateachotherasAllyWithSharedVisionPlayer-MakeallplayersinGroup.Team2treateachotherasAllyWithSharedVision
Have you tried running debug message tests to see what the trigger is "really" doing? For each possible action you have a different debug message and also another debug message for displaying variable before and after to see what happened.
I've made triggers before which I thought did one thing but did another.
While looking up which key to use for the event, type num into the search field. "Num Pad Decimal" is the same as delete. You'll perhaps need to create a global boolean variable to keep track of whenever the "Num Lock" key is pressed if you want Del and the Decimal keys (which are the same keys) to act differently when numlock is on/off.
The secret is using the trigger "point with polar offset" and using "unit-facing (angle) + adding certain angles for different directions". Like 0 is forward, 180 is backwards, 90 for right, and 270 for left. Then you can simply change the yaw of the camera to the units facing.
If you want the unit to move based on the camera use "camera yaw" instead of "unit-facing (angle)".
0
I don't have the time right now to go into detail beyond this...
"Heght of (some unit)" is a function
"UnittoFollow" is simple a variable containing the unit.
As for one script for all players:
0
Your looking for something like this.
0
Use the trigger "apply" instead of "set"
0
@FoxyMayhem: Go
I guess the wording can be a bit confusing. The variable will simply hold which player the loop is currently running for, it's just letting you pick which variable you want to use instead of doing it itself. Make a local integer variable and use that for the "player variable".
Also its just like the trigger under it called "Pick each player in (player group) and do actions", except in this case the trigger itself will provide the variable. So instead of using a local variable for the player you'd use the function "picked player".
0
@butterflo: Go That message at the bottom is so small that I didn't even see it until checking back a day later.
I have no idea why it does what it does. if you really want to know debug each line of code.
0
My bad. I was simply asking if you still wanted to convert your while-loop to a for-loop and where you were at with the code.
0
@FuzzYD: Go
Yes and no. While loops, if not properly made or the unexpected happens, can run on forever crashing the game. So I don't use them often. If it works for you it works. I believe FoxyMayhem said there was a chance of their being a fourth column, so it's uncertain if he'd need the for-lopp to run 3 or 4 times. and therefore a while-loop wouldn't probably be a good option as long as safety's were added.
As for the for-loop not working, you probably missed something as for-loops can do anything while-loops can, you just need to change the code a bit. You just need to debug it to hell.
So where is this project currently at?
0
@Kueken531: Go :) That's basically what I did. Recreated the framework trigger, debugged the hell out of it, and found dead units getting referenced again.
0
I've done some testing and I've found perhaps one problem. In your repeat/switch-case part of the trigger, killing a unit does not remove it from the unitgroup, in which case the trigger may be reusing an already dead unit (closet unit to point). To fix it, create another unitgroup variable, copy the original unitgroup to the new variable, and use this new variable instead for the repeat/switch part, and after you kill the unit add a trigger to remove the unit from the new variable.
See if this solves the problem, otherwise I'll have to keep looking.
0
@butterflo: Go
You said raw version, does that mean you made it in GUI? If so post that too. I'm not too good at reading raw/galaxy.
0
Have you thought about player groups for this task?
0
Edit: I forgot to read all the posts on page one lol. Deletes everything.
0
Have you tried running debug message tests to see what the trigger is "really" doing? For each possible action you have a different debug message and also another debug message for displaying variable before and after to see what happened.
I've made triggers before which I thought did one thing but did another.
0
While looking up which key to use for the event, type num into the search field. "Num Pad Decimal" is the same as delete. You'll perhaps need to create a global boolean variable to keep track of whenever the "Num Lock" key is pressed if you want Del and the Decimal keys (which are the same keys) to act differently when numlock is on/off.
0
The secret is using the trigger "point with polar offset" and using "unit-facing (angle) + adding certain angles for different directions". Like 0 is forward, 180 is backwards, 90 for right, and 270 for left. Then you can simply change the yaw of the camera to the units facing.
If you want the unit to move based on the camera use "camera yaw" instead of "unit-facing (angle)".
Diablo like control system: http://www.sc2mapster.com/forums/resources/tutorials/25464-new-diablo-controls-tutorial/
WSAD system: http://www.sc2mapster.com/forums/resources/tutorials/6981-trigger-reduced-lag-wasd-movement/