Home   Help Search Login Register  

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

0 Members and 1 Guest are viewing this topic.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
most definitely a typo

Mr.Pibb

  • Guest
 k, caught the same typo in second script, removed the parenthesis, and guess what? same results. Once again the town 'grudge' wont hold, always allows re-entery into town as freindly after kill.

 Certainly a pattern here, dont know alot like I said, but being that "town0" is an array if I am correct, would the Bug I found out about might be causing this, where its being returned as null? I tried using a trigger to get this to work, but then cant get the pos with a trigger, so, dunno. Would it be possible if this were because of that array bug to assign the Town with a trigger alone, aside from the GameLogic? The info on the 'array bug' also stated possibility of using a delay for the init.sqs , but I have no idea about that...
« Last Edit: 03 Dec 2004, 03:13:35 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
can't be, one, when you run the script it has already left the "init stage" and two, i didn't use any arrays in the second one

i changed one more thing here, rather than use a boolean (true/false), i tried using 0 and 1.

Code: [Select]
_center = _this select 0
_radius = _this select 1
_town = _this select 2
_Grudge = 0

#checkIn
_RatingChange = 0
?player distance _center <= _radius:goto "checkFriendlyKills"
goto "checkIn"

#checkFriendlyKills
?_Grudge == 1:goto "LowRating"
_EntryRating = rating player
#CheckRatingDrop
?rating player < _EntryRating:_RatingChange = (_EntryRating - (rating player)); _Grudge = 1; goto "LowRating"
?player distance _center > _radius:goto "CheckIn"
goto "CheckRatingDrop"

#LowRating
player addrating -100000
#WhileIn
?player distance _center > _radius:player addrating 100000;player addrating _RatingChange;goto "checkIn"
?rating player != (_EntryRating - _RatingChange):_RatingChange = (_EntryRating - (rating player))
goto "WhileIn"

i truly don't know what is wrong here, because there aren't any error messages, and all my checks work and the goto commands have the right labels....

Mr.Pibb

  • Guest
 Same deal Triggerhappy, no grudge held

 Just to be sure on my part, none of the GameLogics are named, which dosent matter am I correct?

 Also, no need to restart ofp to properly run the new scripts either? (prolly dumb questions, just makin sure its not me)

 Dunno man, but I sure appreciate all u have done thus far, might be able to work in the town 'grudge' thing with triggers if needed, at least it seems u got everything else working.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
no, you have it all right.
I split it into 2 scripts now, the first, town.sqs just needs the center and the radius, and it will exec the other, which needs to be called holdgrudge.sqs you can also have all the towns you want now

Code: [Select]
_center = _this select 0
_radius = _this select 1

#checkIn
?isnull player:exit
?player distance _center <= _radius:goto "checkFriendlyKills"
~2
goto "checkIn"

#checkFriendlyKills
_EntryRating = rating player
#CheckRatingDrop
?isnull player:exit
?rating player < _EntryRating:_RatingChange = (_EntryRating - (rating player)); [_center,_radius,_EntryRating, _RatingChange] exec "holdgrudge.sqs";exit
?player distance _center > _radius:goto "CheckIn"
~2
goto "CheckRatingDrop"


Code: [Select]
_center = _this select 0
_radius = _this select 1
_EntryRating = _this select 2
_RatingChange = _this select 3
goto "LowRating"

#checkIn
?isnull player:exit
?player distance _center <= _radius:goto "LowRating"
~2
goto "checkIn"

#LowRating
player addrating -100000
#WhileIn
?isnull player:exit
?player distance _center > _radius:player addrating 100000;player addrating _RatingChange;goto "checkIn"
?rating player != (_EntryRating - _RatingChange):_RatingChange = (_EntryRating - (rating player))
~2
goto "WhileIn"

Mr.Pibb

  • Guest
 Ok, will try it

 Spent the last half an hour looking at yer previous scripts, must say some impressive stuff there- like the rating change that is gotten when an 'act' is committed, so it can be added when player leaves so he returns to the same rating he had ;)

 thanks

Mr.Pibb

  • Guest
 Well I dont want to say it, but its still the same problem here.
 Although I noticed this time that it didnt even respond to killing the second time in the town after killing and leaving the first time, starting to wonder if this might be a problem with the addrating command itself, might be that it only works a few times per player? Going to re test an earlier script and see if it works a bunch of times, but then I gotta hit it for tonight.

« Last Edit: 03 Dec 2004, 04:49:33 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
i don't know, you should be able to use addrating as much as you want...
i'm out of ideas for how to do this at the moment anyway, good timing

Mr.Pibb

  • Guest
 Actually bad timing lol, its going on midnight once again on a work night.

 Ya, I switched him back and forth 6 times using triggers from enemy to freindly, all worked fine. I keep thinkin maybe its the rating numbers, somehow gettin a lil mixed but ur equations work out for  re-setting the players rating (had to actually pull out the calculator just to be sure lol)
 
 Oh well, can tell i am gettin tired when I start naming sqs files as town.sqs and then spent 10 min trying to figure out why it couldnt find the script  :-\

 later  :)
« Last Edit: 03 Dec 2004, 05:39:29 by Mr.Pibb »

Mr.Pibb

  • Guest
 Tested again and found that actually not only does the 'grudge' not work returning to town after killing, but also commiting kills arent activating the rating drop either.

« Last Edit: 03 Dec 2004, 06:53:13 by Mr.Pibb »

Mr.Pibb

  • Guest
Triggerhappy :)

 Duuuude, took the hint format trigger that Sui made in the PibbHelp test mission and put one tirgger right in the town prox and one outside the town prox to test ratings and ....- everything frikin works!
 The problem is the ratings equations in the resetting of the rating upon leaving, its set too high and when a player with 'grudge' against him returns to town he only gets set down to his original rating, in this case 3500 (captian init rating). I will take a good long look at the equations and see what I can do, any help appreciated. Also, if you could recomend which of these scripts u made would be seemingly the best(least lag maybe) to try to use for re-testing, that would be great too, they prolly all work tho ;) lol
 What a load off my mind, and urs too im sure when u read this.
 
 Heres the numbers:

Initial Rating Player Unit : 3500

Comitted in town kill, rating set to -97900

When leaving town radius with above rating, rating then set to: 103500 <-- too high to for 100,000 rating drop to work for grudge activation or another town kill.

When returning to town radius with grudge, of course, rating set back to 3500.

« Last Edit: 03 Dec 2004, 22:10:51 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
found the problem(i think):
when i was adding the _ratingChange, i think it was made after the -100000 was added to him
This is the best script as far as lag and stuff, also you can have all of the towns you want, and you don't need a second script

Code: [Select]
_center = _this select 0
_radius = _this select 1
_town = _this select 2
_Grudge = false

#checkIn
_EntryRating = 0
_RatingChange = 0
?player distance _center <= _radius:goto "checkFriendlyKills"
goto "checkIn"

#checkFriendlyKills
?_Grudge:goto "LowRating"
_EntryRating = rating player
#CheckRatingDrop
?rating player != _EntryRating:_RatingChange = (_EntryRating - (rating player))
?rating player < _EntryRating:_Grudge = true); goto "LowRating"
?player distance _center > _radius:goto "CheckIn"
goto "CheckRatingDrop"

#LowRating
player addrating -100000
#WhileIn
?player distance _center > _radius:player addrating 100000;player addrating _RatingChangegoto "checkIn"
?rating player != ((_EntryRating - 100000) - _RatingChange):_RatingChange = ((_EntryRating - 100000) - (rating player))
goto "WhileIn"

Mr.Pibb

  • Guest
Just got in yer message there, um, before I even test that, take a look at this, cause this seemed to fix it perfect .


Took the script line:

?player distance _center > _radius:player addrating 100000;player addrating _RatingChange;goto "checkIn"

 and removed: player addrating 100000

 Works perfect so far, returns rating to proper previous entry rating every time leaving the radius, and returning to town of course then works, the grudge variable seems to work fine.

 Let me ask, in the case of more than one player being in a town and say all of them commit a kill, the script should execute for each one of them on their puters and should do fine with handling it all, correct? Just askin cause its something I really cant test alone, so it will have to be a 'given' till beta testing way down the road.
 I will start testing with multiple towns to make sure whole picture here is sound, but I think this thing is a wrap. :)

 Hopefully when I extract this script from the test mission to the real mission im workin on it dosent cause any noticable lag.
 
 If Sui dosent come up with anything better and all the testing is finished I would like to see this thing up as a script addon in the editors depot as Triggerhappys script, so other people can use it, as long as that would be fine with u Triggerhappy, or u can put it up, whatever on that. :)

 Thanks man, I know you put ALOT of time and hard work into that.
« Last Edit: 03 Dec 2004, 22:47:42 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
1) yeah, i basically did that, but in a different way, the last one does the same thing, but overal the whole script will be better. I need to add a few delays so it won't lag

2)thats right

3)
Quote
Thanks man, I know you put ALOT of time and hard work into that.
if you say so...
idon't care if you send in my script, just credit me, and you'll need to make a readme for it

Mr.Pibb

  • Guest
 Ya, i say so, for putting that much time into something of someone elses mission, id say u went out on a limb a bit, and I appreciate it.

 Ok, tested yer new script and it does work (removed a few typos, no biggies)
 Only thing I noticed was on the second time around coming out of the town it set the rating to 0, instead of 3500. Weird. When I tested the script I removed the addrating 100000 it never did that, always set to 3500 (original entry rating).
 Hmm. Can we just use the last script u just made and do the same, just remove the addrating 100000 and leave the other extra rating stuff out?
 fyi- used the script from repy #41, top script with the removal of the addrating 100000.

 And about the delays, the radius's will be huge, 700 prolly to ensure no player can even see the town or the occupants before entering the radius, so delays would prolly work great.

 
« Last Edit: 03 Dec 2004, 23:31:37 by Mr.Pibb »