Home   Help Search Login Register  

Author Topic: Please a lil help with fairly simple Trigger Condition Script here/Rating  (Read 5491 times)

0 Members and 2 Guests are viewing this topic.

Mr.Pibb

  • Guest
 Unfortunately it dosent work either, typed as :

 Condition:this && "(_x == player) && rating_x < (-2000)" count thislist > 0

 Also tried this in case Sui, u meant directly type what u put:

 Condtion:this && "rating_x < (-2000)" count thislist > 0

 both didnt return errors in game, but the trigger never got tripped and of course the player had their rating set below -2000

 My mind is boggled at this point.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Try using it exactly as I typed it.

No need to have the this &&.

Also make sure you have a space between the rating and the _x.

I'd suggest copying and pasting from the line I typed... sometimes these things have to be exact ;)

Also, do you have the trigger set to West Present, and set to repeatedly?
« Last Edit: 30 Nov 2004, 03:41:20 by Sui »

Mr.Pibb

  • Guest
 Thanks for still keeping the idea alive Sui ;)

 Ya, the west present is on , set to repeatedly

 Pretty sure I typed it right, but ill try it again without the 'this &&'.

 Honestly I dont know how u can copy something and then paste it right into a feild in mission editor (tried and dont know what command is used)

 I have come up with a way to do this that hopefully wont lag if nothing else works, but I do 2 questions if u dont mind :)

 Heres my untested setup for this, first is the trigger, all Proximity Triggers here are around Town0

West Presesnt, Repeatedly

Condit: This

Activation: [thislist, Town0] exec "PlayerInTownArea.sqs"

 Script: PlayerInTownArea.sqs

;Script usage:  [Unit,Town] Exec "PlayerInTownArea.sqs"

_westplayer = _this Select 0
_town = _this Select 1


? (_westplayer == WestAlphaLeader):_town == WALT
? (_westplayer == WestBravoLeader):_town == WBLT

Exit

 Now the 2nd trigger this may activate (depending on town, player)

 WBLT Trigger:

 No activation requirements, Repeatedly

 Cond: WBLT == Town0 && rating WestBravoLeader < -2000 || WBLT == Town0 && badfactionWBLtown0
 
Activation: badfactionWBLtown0 = true;WestBravoLeader addRating - 100000

 There is one more 'deactivation' trigger that is activated by this trigger that checks if this player is no longer presesnt

  WestBravoLeader (player) is grouped to this trigger

 West, Not Present, Repeatedly

Condition: this && WBLT == Town0
 
Activation: WBLT = grpNull

 Ok, all that said and done my question-

 If I use _town,(which in this case would be equal to 'Town0') to be equal to WBLT, when WBLT is next checked by Trigger to see if its equal to Town0, it should return true correct? And lastly, my greatest concern is each time this script is executed of course _town and _westplayer will change,say they change to equal to 'WestAlphaLeader, Town5'   this will not affect the equality that WBLT has to '_town' which was equal to 'Town0'in the "WBLT" trigger, would it? I am hoping not, that once the reference is made with _x variables that if the _x's equality changes to something else that it dosent affect previous equalities made with it.
 
 So there will be 1 actual 'proximity' trigger always active per town, 9 'not present' triggers per town, and nine condition 'only' triggers. Only 2 of the 18 triggers in a town will be activated if a player commits the freindly kill.
 So, technically, if I am right, only the one proximity trigger per town will be of any consequence for lag purposes, the rest will only be activated upon the conditions met, does this seem doable? Only as time goes on thro making the mission will I know if this will present a lag problem.

 Anyhow, if u gave up completely on this I dont blame u lol, but this is actually a simplified version of what I had earlier, which was a real complex mess. Whatever it is, if it does the job and dosent lag the game, im happy.

 I will give that script a try again, but I fear the worst, something seems to be causing a problem everytime, I think assigning a variable thro the condition field just dosent work, maybe because it only uses statements as 'conditions', and wont actually assign anything thro it, unlike the activation feild. I will test that theory by just taking the players name and replacing the variable assigning with it too. Im just speculating tho, which is why I need to start reading some of these tutorials I got, lol, less guessing.

 Thanks again Sui.

 Christian
 

 
« Last Edit: 01 Dec 2004, 00:42:54 by Mr.Pibb »

Mr.Pibb

  • Guest
 The trigger still wont work, and unfortunately my script/trigger setup will need an overhaul too, cause its not respondign either, will prolly do some work to the script tommorow and see if I cant get it running and get a text response.

 Thanks all for the help thus far, I guess what I thought would be a simple script line has turned into alot more.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
West Presesnt, Repeatedly

Condit: This

Activation: [thislist, Town0] exec "PlayerInTownArea.sqs"

Script: PlayerInTownArea.sqs

;Script usage:  [Unit,Town] Exec "PlayerInTownArea.sqs"

_westplayer = _this Select 0
_town = _this Select 1


? (_westplayer == WestAlphaLeader):_town == WALT
? (_westplayer == WestBravoLeader):_town == WBLT

Exit
thislist is an array, so you are trying to pass an array to a script that needs an object

also, if i understand your problem correctly, you shouldn't need 9 triggers for each town, just one.  You want to have it run the script only for one unit, right? so at the beginning of the script, couldn't you just put:
Code: [Select]
?_westplayer != player:exitafter _town = _this select 1?

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Holy sheet!!

You learn something new about flashpoint every day...

I just threw my trigger into the editor, and found that you're right, Mr. Pibbs it doesn't work.

I set it to West present, and it wouldn't activate.

So then I set it to anybody present, and it worked!

That led me to wonder what side my WEST unit was if it wasn't setting off a west trigger...
A hint [format] later, and it seems that with a rating of less than -2000 and the unit gets assigned to a side called ENEMY.

Mission attached... see for yourselves!

God I love it how this game can still do the unexpected....

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
hmmm.. so i wonder what east,resistance,and maybe even civs go to.
it can't be enemy i don't think, because then if an east and a west are both below -2000 for their rating they would both be put on the side enemy, making them on the same team. If logic has any meaning in this...

Mr.Pibb

  • Guest
 Nice to hear that its not a fatal problem ( I hope) , gotta run to work now, but Ill try that test mission when I get home. Thanks for going thro the trouble of testing it Sui, I wonder, can U group multiple players to a trigger?(hope hope)
 Triggerhappy, there will actually be nine west players, but ya, just want a check on who is in the town area and if their rating is > -2000, which could be multiple players in that area.

 Gotta run now, be back later

 Thanks

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
There is also a side friendly......and maybe a side logic also.

I know that there are 3 undocumented commands relating to this aspect of things.

sideEnemy
sideFriendly
sideLogic

I've never played with them yet, but I presume they could be used to check what side a unit is assigned to at any given moment.


Planck
I know a little about a lot, and a lot about a little.

Mr.Pibb

  • Guest
 Yes, it certainly now works with any present

 Bad thing is I am finding that if there are 2 or more players with rating <-2000  within the area covered by the trigger it only activates once for the first, then wont activate again if the other player goes < -2000, maybe because it only sees the 1st player with bad rating and never gets past him to check on others, so it still looks like I will have to make one trigger per player for each town using this trigger script along with grouping, unless u guys know of a way to script condition so it wont keep only looking at the same guy that has the low rating.

 Christian

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Code: [Select]
Activation: [thislist, Town0] exec "PlayerInTownArea.sqs"

Script: PlayerInTownArea.sqs

;Script usage:  [Unit,Town] Exec "PlayerInTownArea.sqs"

?!(player in (_this select 0)):exit
_westplayer = player
_town = _this Select 1

? (_westplayer == WestAlphaLeader):_town == WALT
? (_westplayer == WestBravoLeader):_town == WBLT

Exit

does this work?

Mr.Pibb

  • Guest
 Hey Triggerhappy, no, I still havent gotten the Trigger/ScriptFile method to work, honestly being my temporarily limited undertanding of the definitions of many of the script commands, I am not going to proceed any farther into trying that myself, I could go on for days and still have something inputed wrong.

 So, heres my last attempt, I got the essentials for testing both methods, mine and Sui's in a Test MP mission attached to this post.
 U can try my method with Group Alpha Black, and Sui's method with Group Alpha Red.
 Again, it is MP, so of course u gotta put it in a User's MP folder. :)

 There is a breif readme with it, please read it real quick if u would, cause it gives a some info as to what is happening when the test runs and how to set up a test for Sui's method with 2 players in the same trigger area. Lastly, make sure when selecting a player that u leave the other slot with ai Off, except where I describe using him to test 2 players with Sui's trigger in the readme.

 Thanks in advance

Christian
« Last Edit: 02 Dec 2004, 01:21:51 by Mr.Pibb »

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Ahhh... ok. So you're looking to have the trigger run a script passing the particular unit to the script?

Try something like this:

Trigger
Radius: as required
Condition: Anybody Present (repeatedly)
Condition Field: "rating  _x < (-2000)" count thislist > 0
OnActivation field: "if (rating _x < (-2000)) then {[_x, town0 ] exec ""PlayerinTownArea.sqs""}" foreach thislist

So using that trigger, the script will run once for each unit in the trigger with a rating below -2000. You'd reference the unit by using: _this select 0

Be sure to type it exactly (note the double "", it's important! :) ), or you can copy/paste it from here into OFP (Ctrl + C, then Ctrl + V in flashpoint).
« Last Edit: 02 Dec 2004, 01:27:50 by Sui »

Mr.Pibb

  • Guest
 Im on it

 But, I have to say, if u try the test mission I have, u will find that its not the problem with your condition script that its not being passed to a script, its that the trigger wont activate for more than one player in the proximity of the trigger.
 I put text that comes up upon activation of the trigger, and it only comes up once with both players at -2000 rating status, might wanna look at that :)

Thanks

 
« Last Edit: 02 Dec 2004, 01:44:26 by Mr.Pibb »

Mr.Pibb

  • Guest
just tested it, honestly I dont know if the trigger is working right-the text i put in only came up once with both players in the radius and below -2000 at different times, I do know my script in the dang "PlayerInTownArea.sqs" isnt, cause it should have tripped another trigger that put text up, nothing.

Heres the script:

_westplayer = _this Select 0
_town = _this Select 1

_westplayer = player

? (_westplayer == WestAlphaLeader):goto "WestAlphaLeader"
? (_westplayer == WestBravoLeader):goto "WestBravoLeader"

Exit


#WestAlphaLeader

? (_town == Town0):BadfactionWALtown0 == WestAlphaLeader;variable5 = true;Exit

#WestBravoLeader

? (_town == Town0):BadfactionWBLtown0 == WestBravoLeader;variable5 = true;Exit

And a trigger was set with condition variable5, and has text that never showed.

And alas another problem is that I will need to somehow reference a badfaction variable to each player each time they go -2000 rating(tried to do this in the above script) and then I need to have that be a seperate condition along with the -2000 rating in the trigger(using || after ur script and then reference) Dont know how to make a variable like BadfactionWBLtown0 referable to a player, hmm.