So I have a set of triggers that will run an action definition when a unit enters a region (depending on the trigger it's different of course.)
When the unit enters the region, though, the trigger bugs out and runs the action definition indefinitely for approximately 3 seconds and then kicks the player. Which is not what I'm trying to accomplish.
Here's what I have so far:
Action definition
OffenseDeterminationOptions:Action,CreateThreadReturnType:(None)ParametersPlayer=(Ownerof(Triggeringunit))<Integer>TriggeringUnit=(Triggeringunit)<Unit>GrammarText:OffenseDetermination(Player,TriggeringUnit)HintText:Determineswhooffendedandhowtodealwiththem.CustomScriptCodeLocalVariablesActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayer==0ThenUnitGroup-Pickeachunitin(AnyunitsinOuterLimitsownedbyplayerPlayermatchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsUnit-Move(Pickedunit)instantlyto(Randompointin(Playablemaparea))(NoBlend)ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayer==1TokensforPlayer1<=0ThenVariable-ModifyTokensforPlayer1:+1Variable-SetPunishedPlayer=PlayerVariable-SetPunishedUnit=TriggeringUnitTrigger-RunFirstoffense(CheckConditions,Don't Wait until it finishes) Else Variable - Set Punished Player = Player Trigger - Run Final Offense (Check Conditions, Don'tWaituntilitfinishes)General-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayer==2TokensforPlayer2<=0ThenVariable-ModifyTokensforPlayer2:+1Variable-SetPunishedPlayer=PlayerVariable-SetPunishedUnit=TriggeringUnitTrigger-RunFirstoffense(CheckConditions,Don't Wait until it finishes) Else Variable - Set Punished Player = Player Trigger - Run Final Offense (Check Conditions, Don'tWaituntilitfinishes)General-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayer==3TokensforPlayer3<=0ThenVariable-ModifyTokensforPlayer3:+1Variable-SetPunishedPlayer=PlayerVariable-SetPunishedUnit=TriggeringUnitTrigger-RunFirstoffense(CheckConditions,Don't Wait until it finishes) Else Variable - Set Punished Player = Player Trigger - Run Final Offense (Check Conditions, Don'tWaituntilitfinishes)Variable-SetOffenseDeterminedandDealtWith=True
One of the triggers (again they are virtually the same but with different regions):
FirstoffenseEventsLocalVariablesConditions((Currenttrigger)ison)==TrueActionsTrigger-Turn(Currenttrigger)OffUI-Display"WARNING: You have tried to expliot..."for(Playergroup(PunishedPlayer))toWarningareaUnit-MovePunishedUnitinstantlyto(RandompointinPunishmentRegion)(Blend)Unit-Add1ExploitedGameFeatureorBugtoPunishedUnitfromPunishedUnitTrigger-Turn(Currenttrigger)On
The final offense trigger does basically the same thing.
So why isn't this working???
Everything I've tried thus far is still coded in.
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
turning the trigger on and off basically does nothing.
"The first offense trigger: " has no event
learn how to use switch statements ....
its better then a mess of if''s ..... you should screen shot the triggers .... The text mess isnt the easiest way to view these things.
what is this condition..... "Offense Determined and Dealt With == False"
what are you trying to do in the first place.... I can prolly suggest a simpler solution.
Triggers should always have an event or events.... if your running a trigger from another trigger then you should prolly be using an action definition instead
Is this a standard variable for each player "Variable - Modify Tokens for Player 1: + 1"
should prolly use an array with the player index to keep track of this stuff on a per player basis.
This bit of code is going to attempt to run extra times because of the way your if statements are
Variable - Set Punished Player = Player
Trigger - Run Final Offense (Check Conditions, Don't Wait until it finishes
I use switches all the time. When it comes to a player it has trouble (at least for me) thus I use if than else for those.
First offense is run through the action definition.
I want it to run 1 time each time a unit enters. That's it. But it runs multiple times.
If you must have a picture I can take one, but this is directly out of the editor. So I don't see how pictures would make a difference.
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
Please read what I say more carefully next time....
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
So bugs that seem to plague some users of the editor and not others don't exist right?
EDIT: You know what, I'm not going to fight this. If you have an answer I'll be glad to hear you. If you're going to fight with me please take that elsewhere.
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
So bugs that seem to plague some users of the editor and not others don't exist right?
EDIT: You know what, I'm not going to fight this. If you have an answer I'll be glad to hear you. If you're going to fight with me please take that elsewhere.
I already said why your triggers are running too many times...
if you refuse to use a switch you need to nest your if's....
or you can shoot me the file on skype and ill make it work for you in a few minutes
your also setting a parameter = to Triggering Unit .... with out an event...... this does not work.
The wait of 3 seconds stopped, but the trigger error sure didn't.
It still kicks me instead of warning me. Which only means it is running too much.
Any other ideas?
OffenseDeterminationOptions:Action,CreateThreadReturnType:(None)ParametersPlayer=(Ownerof(Triggeringunit))<Integer>TriggeringUnit=(Triggeringunit)<Unit>GrammarText:OffenseDetermination(Player,TriggeringUnit)HintText:Determineswhooffendedandhowtodealwiththem.CustomScriptCodeLocalVariablesActionsGeneral-Switch(Actions)dependingonPlayerCasesGeneral-If(0)ActionsUnitGroup-Pickeachunitin(AnyunitsinOuterLimitsownedbyplayerPlayermatchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsUnit-Move(Pickedunit)instantlyto(Randompointin(Playablemaparea))(NoBlend)General-If(1)ActionsGeneral-Switch(Actions)dependingonTokensforPlayer1CasesGeneral-If(0)ActionsVariable-ModifyTokensforPlayer1:+1Variable-SetPunishedPlayer=PlayerVariable-SetPunishedUnit=TriggeringUnitTrigger-RunFirstoffense(CheckConditions,Don't Wait until it finishes) General - If (1) Actions Variable - Set Punished Player = Player Trigger - Run Final Offense (Check Conditions, Don'tWaituntilitfinishes)DefaultGeneral-If(2)ActionsGeneral-Switch(Actions)dependingonTokensforPlayer2CasesGeneral-If(0)ActionsVariable-ModifyTokensforPlayer2:+1Variable-SetPunishedPlayer=PlayerVariable-SetPunishedUnit=TriggeringUnitTrigger-RunFirstoffense(CheckConditions,Don't Wait until it finishes) General - If (1) Actions Variable - Set Punished Player = Player Trigger - Run Final Offense (Check Conditions, Don'tWaituntilitfinishes)DefaultGeneral-If(3)ActionsGeneral-Switch(Actions)dependingonTokensforPlayer3CasesGeneral-If(0)ActionsVariable-ModifyTokensforPlayer3:+1Variable-SetPunishedPlayer=PlayerVariable-SetPunishedUnit=TriggeringUnitTrigger-RunFirstoffense(CheckConditions,Don't Wait until it finishes) General - If (1) Actions Variable - Set Punished Player = Player Trigger - Run Final Offense (Check Conditions, Don'tWaituntilitfinishes)DefaultDefault
Secondly
the triggering unit is the entering unit. It is called beforehand for convenience. Which I have done before and know works.
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
Therefore when the definition is used in that trigger it will call that unit and it's owner. If you make them equal beforehand, it doesn't matter if they weren't valid before. It will still call the correct units and players. But for the sake of argument. I'll go and change that now.
Players are integers. If I call 0 that means neutral. 1 means player 1, etc.
Then for the tokens since I don't need an action past one token it should run the final trigger once the token is = 1 since 1+1=2 and 2=boot.
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
As far as I am aware... when you call an action definition .... actions with-in the action definition can not refer to the originating Triggers events..... this is why you pass the values through parameters to the action definition. This is how all programming languages work.
To help any more Id need to debug the map locally.
I would also suggest chaning the name of the parameter "Triggering Unit" to something like..... TempUnit.
This allows people to better read your code and not confuse it with a real "Triggering Unit". It also might prevent scripting errors.
The parameters in the Action definition should not have a "= anything".
Your already properly passing the values from your triggering event to the action definition. Having the "= anything" may improperly assign a value over the passed value from the trigger.
When in dbout add Debug Text messages that tell you when the tokens are incrementing and what thier current values are....
try disabling the "kick" mechanism and instead just add a text message in its place that says something like "YOU HAVE BEEN KICKED MR FAIL SAUCE!""" this way you can keep debuging it and watching it rather then get kicked right away.
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
Sorry, my internet has a cap so when I download packets (I.E. use anything other than a browser) my internet slows to what is almost a halt and I use a lot of my allotted time. But feel free to PM if comments won't cut it. I'll be on until around 8.
This is what the debugger says when I disable the kick feature.
No text messages though which worries me.
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
If your trying to prevent players from entering certain areas you might just want to paint the terrain with the "No Pathing" Tool. Dunno if your familiar with that or not.
It has everything you could possibly need for debugging this particular problem. The rest of my triggers have nothing to do with this problem. Because it still persists.
The firing events (or just the events, I suppose) are 1,2,3, and 4.
EDIT: I've begun to fix it. It must be one of those times you get a bug for no reason. Because the exact same circumstances and a few placeholder units deleted and now I get the debuff. I still can't move the unit, but I'm very close to fixing it.
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
So I have a set of triggers that will run an action definition when a unit enters a region (depending on the trigger it's different of course.)
When the unit enters the region, though, the trigger bugs out and runs the action definition indefinitely for approximately 3 seconds and then kicks the player. Which is not what I'm trying to accomplish.
Here's what I have so far:
Action definition
One of the triggers (again they are virtually the same but with different regions):
The first offense trigger:
The final offense trigger does basically the same thing.
So why isn't this working???
Everything I've tried thus far is still coded in.
@Yaksmanofage: Go
turning the trigger on and off basically does nothing.
"The first offense trigger: " has no event
learn how to use switch statements ....
its better then a mess of if''s ..... you should screen shot the triggers .... The text mess isnt the easiest way to view these things.
what is this condition..... "Offense Determined and Dealt With == False"
what are you trying to do in the first place.... I can prolly suggest a simpler solution.
Triggers should always have an event or events.... if your running a trigger from another trigger then you should prolly be using an action definition instead
Is this a standard variable for each player "Variable - Modify Tokens for Player 1: + 1" should prolly use an array with the player index to keep track of this stuff on a per player basis.
This bit of code is going to attempt to run extra times because of the way your if statements are
Variable - Set Punished Player = Player
Trigger - Run Final Offense (Check Conditions, Don't Wait until it finishes
@SouLCarveRR: Go
I use switches all the time. When it comes to a player it has trouble (at least for me) thus I use if than else for those.
First offense is run through the action definition.
I want it to run 1 time each time a unit enters. That's it. But it runs multiple times.
If you must have a picture I can take one, but this is directly out of the editor. So I don't see how pictures would make a difference.
@Yaksmanofage: Go
switches work fine on players......... they are just integer values
@SouLCarveRR: Go
(at least for me)
Please read what I say more carefully next time....
@Yaksmanofage: Go
theres no such thing as just for you... they work the same for all of us.....
@SouLCarveRR: Go
So bugs that seem to plague some users of the editor and not others don't exist right?
EDIT: You know what, I'm not going to fight this. If you have an answer I'll be glad to hear you. If you're going to fight with me please take that elsewhere.
@Yaksmanofage: Go
its not a bug is what im saying......
I already said why your triggers are running too many times...
if you refuse to use a switch you need to nest your if's....
or you can shoot me the file on skype and ill make it work for you in a few minutes
your also setting a parameter = to Triggering Unit .... with out an event...... this does not work.
@SouLCarveRR: Go
Switching right?
The wait of 3 seconds stopped, but the trigger error sure didn't.
It still kicks me instead of warning me. Which only means it is running too much.
Any other ideas?
Secondly the triggering unit is the entering unit. It is called beforehand for convenience. Which I have done before and know works.
@Yaksmanofage: Go
From what I can see your not using parameters correctly....... read my prior post
parameters should not be set to = anything.... the value should be passed through the parameter from where you called the action definition
what is the if 0, if 1 code for....... it shouldnt be like that or it should reference a variable of some kind
the triggering unit .... may appear to work like that but with out an event that generates a triggering unit .... it will always = 0
@SouLCarveRR: Go
that = triggering unit.
Therefore when the definition is used in that trigger it will call that unit and it's owner. If you make them equal beforehand, it doesn't matter if they weren't valid before. It will still call the correct units and players. But for the sake of argument. I'll go and change that now.
Players are integers. If I call 0 that means neutral. 1 means player 1, etc.
Then for the tokens since I don't need an action past one token it should run the final trigger once the token is = 1 since 1+1=2 and 2=boot.
@Yaksmanofage: Go
As far as I am aware... when you call an action definition .... actions with-in the action definition can not refer to the originating Triggers events..... this is why you pass the values through parameters to the action definition. This is how all programming languages work.
To help any more Id need to debug the map locally.
@Yaksmanofage: Go
I would also suggest chaning the name of the parameter "Triggering Unit" to something like..... TempUnit.
This allows people to better read your code and not confuse it with a real "Triggering Unit". It also might prevent scripting errors.
The parameters in the Action definition should not have a "= anything".
Your already properly passing the values from your triggering event to the action definition. Having the "= anything" may improperly assign a value over the passed value from the trigger.
When in dbout add Debug Text messages that tell you when the tokens are incrementing and what thier current values are....
try disabling the "kick" mechanism and instead just add a text message in its place that says something like "YOU HAVE BEEN KICKED MR FAIL SAUCE!""" this way you can keep debuging it and watching it rather then get kicked right away.
@SouLCarveRR: Go
Well I changed it so it didn't call anything it and still nothing. Fixing up the map for debug release.
@Yaksmanofage: Go
ill be taking a look .... do you have skype I can conteack you on?
@SouLCarveRR: Go
Sorry, my internet has a cap so when I download packets (I.E. use anything other than a browser) my internet slows to what is almost a halt and I use a lot of my allotted time. But feel free to PM if comments won't cut it. I'll be on until around 8.
This is what the debugger says when I disable the kick feature.
No text messages though which worries me.
@Yaksmanofage: Go
If your trying to prevent players from entering certain areas you might just want to paint the terrain with the "No Pathing" Tool. Dunno if your familiar with that or not.
@SouLCarveRR: Go
It has everything you could possibly need for debugging this particular problem. The rest of my triggers have nothing to do with this problem. Because it still persists.
The firing events (or just the events, I suppose) are 1,2,3, and 4.
EDIT: I've begun to fix it. It must be one of those times you get a bug for no reason. Because the exact same circumstances and a few placeholder units deleted and now I get the debuff. I still can't move the unit, but I'm very close to fixing it.
@Yaksmanofage: Go I misspoke earlier .... I was being a dumb ass and didnt see your triggers 1-4......
Ive re-written all your code to be way more condensed and it will support up to 15 players....
your current code will not handle multiple players at all.... Im just about done just testing it now.......
This is a good example for you to study so you can pick up on some of the finer points of programing.
Hold on a bit just about done