Home   Help Search Login Register  

Author Topic: u guys are gonna hate me..vehicles leaving towns, a prob with 'grudge' script  (Read 2098 times)

0 Members and 1 Guest are viewing this topic.

Mr.Pibb

  • Guest
 Hi again :)

 I cant say vehicles are a 'real' problem with the new script Triggerhappy came up with, its really the dam ofp program, I think.

 Found that a player with 'grudge' rating (rating -2000, renegade status) leaving the radius of the town in a vehicle, yes, he is indeed switched to regular rating status (freindly, above -2000). Problem is the dam vehicle he is in remains 'enemy', thus unless  the player exits and re-enters the vehicle, he is considered enemy in the vehicle even tho his rating is freindly. wierd. On the flip side, entering a town in a vehicle is fine, if his 'grudge' status is set with that town, him and the vehicle go enemy.

 Seems a thing with ofp tho, basically seems vehicles reflect enemy switched to freindly status only if they are boarded by a new side, they wont do it if the guy is still in there when it happens, till he gets out and boards again.

 Now, considered using setcaptive as a new alteration for the script and making res enemy, but in the mission there will be times when u, as player can join res 'clans' and jump in a fight with em, problem there is after trying to use suggested methods for switching sides by grouping the player under enemy res, the player still remains enemy to them, even tho to the player they are considered freindly.

 What really sucks is that I am altering a version of cti, so if a player is still denoted as enemy in a vehicle after leaving a town and tries to enter a new town, it wont add res fighters in that town cause he is denoted as 'enemy' side where I dont know if I can reference that side in the condtion, and making the addRes triggers activate by any side means no civil movements between towns anymore so they wont trip the trigger and cause lag. And of course would have to make it known u have to exit vehicle after these conditons, which is kinda unrealistic.

 So right now, only real alternative is to remove any in-town and town-town civil movements and make 'addRes' triggers activate by anyone, or if I can reference 'enemy' side I wont have to remove civil movements, but would have to force players to exit vehicles upon those certain conditions.
 Unless u guys know of a way to group a player to an res leader at a certain point in the game where the player would be considered freindly to res at that point, with the game set to res enemy to all.
 Or a way to get that dang vehicle to switch to freindly after leaving the town radius, I even used a hint format and the player in the vehicle (me) was at rating 3500, but side was enemy till I disembarked.
 Got a few other ideas rattling, but just wanted to ask before I made a decision in case there is something that could be done to fix this.
 And I thought this case was closed....... :P
« Last Edit: 04 Dec 2004, 22:55:00 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
post the final version of the script and i'll add what you need.
or, if you can find where to put it:
(vehicle player) join player


Mr.Pibb

  • Guest
Thanks for the reply Triggerhappy, although I have an idea where to put it, I put the final version up so u could throw it in there just in case I am wrong :)


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

#checkIn
_RatingChange = 0
?player distance _center <= _radius:goto "checkFriendlyKills"
~2
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"
~2
goto "CheckRatingDrop"

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

Hope it fixes the problem.

 Thanks

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Code: [Select]
_center = _this select 0
_radius = _this select 1
_town = _this select 2
_Grudge = false

#checkIn
_RatingChange = 0
?player distance _center <= _radius:goto "checkFriendlyKills"
~2
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"
~2
goto "CheckRatingDrop"

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

Mr.Pibb

  • Guest
had put it in same place,

Ran first test, got an error

Running second test, if error comes up again Ill type it in bout 5 min

Mr.Pibb

  • Guest
heres the error:

(vehicle player) join player |#|; goto "checkIn" : Error join : Type, Object, expected Array

 Seems to me needs direct name? Can the player that the script is running for be referenced in a variable that could be used? Or I could make a west soldier somewhere, name him and use that name to change the status of vehicles?

« Last Edit: 05 Dec 2004, 01:11:52 by Mr.Pibb »

Mr.Pibb

  • Guest
 changed parenthesis to brackets for [vehicle player] and it did work, but it didnt change enemy status. Said: "one, follow one" when executed, seemed like it was just assigning me to me. Tried using another west unit and it still didnt change vehicle status, I think its a problem with the vehicle itself, not the player even tho the player is considered enemy with freindly rating, its only when he's in the vehicle, and I dont think there is a command to change vehicle side status at all.

 Got a question, I have been trying to find out if a player activated a trigger for dealing with the 'enemy' vehicle bug when a player enters a town with enemy status:

Original Condition:
Condition:
this && ((west countSide thisList > 0) || (east countSide thisList > 0))

And I want to add something like

 this && ((west countSide thisList > 0) || (east countSide thisList > 0) || (player thislist))

And it didnt trip when I went thro (me being on enemy side only player would trip it)

can u tell me what I need to type to reference the player that activated the trigger (if a player did)

 Thanks, I can tell u this is definitely the last peice to the puzzle here, everything else works perfect.
« Last Edit: 05 Dec 2004, 01:40:36 by Mr.Pibb »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
player in thislist

I'm too drunk to understand this thread, but sober enough to comprehend that the code

(player thislist)

doesn't make sense.   There is no verb, or operator I suppose its called in computerProgrammingSpeak.
Plenty of reviewed ArmA missions for you to play

Mr.Pibb

  • Guest
 Thanks macguba, think I tried that already from a script I got from the editors depot, will try again, have tried like friggin 5 dif combos and not one has tripped the dang trigger when the player is 'enemy' side.

 :) never give up, times like this I gotta remember that lol

Mr.Pibb

  • Guest
 the condition still not responding to that either, going to keep looking around for the right script, of course my last option is to merely type all of the players names, but I dont know if that might cause some lag being there would be like 20 triggers with 9 players names in each condition feild.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
go back to using the script.
two options to try:
1)change player in the error part after join to [player]
or
2)change it to group player

Mr.Pibb

  • Guest
sorry to say Triggerhappy, neither worked

 First method returned error ( can get it if need be )
 Second method did execute, said : "one, follow one" and vehicle status remained the same
 Sorry to say but I think as I said earlier this is a problem in ofp, it just wont switch vehicle status from enemy to freindly without vehicle being emptied first.

 Now, :) being it seems there is also no way to reference the 'player' in a condition feild, does anyone know if there is a way to have a player join an res enemy group at some point in game where joining would cause being freindly? My tests so far show joining still keeps u enemy, even tho once joining res are shown as freindly units.

 Prolly just have to improvise here and spend some time thinking about the best way to do this anyhow, thanks for the help :)
« Last Edit: 05 Dec 2004, 03:25:52 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
stroke of inspiration(if thats what it is called):
in place of (vehicle player) join whatever put
(vehicle player) addrating 100000

Mr.Pibb

  • Guest
will get that tested tommorow dude ;)
All pooped out tonight

 will get back on results

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
If it works this is the way it should b implemented so that you won't give the player an extra 1000000 rating when he leaves without a vehicle

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

#checkIn
_RatingChange = 0
?player distance _center <= _radius:goto "checkFriendlyKills"
~2
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"
~2
goto "CheckRatingDrop"

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

#vehicleBugFix
?vehicle player != player: vehicle player addrating 1000000
goto "checkIn"

Mr.Pibb

  • Guest
 Sorry I havent gotten back earlier with you, will test it in a moment. If it dosent work I pretty much have decided to use the script and alter it a bit to use set captive to players and make the res enemy in towns, that would remove the vehicle problem completely, but would cause some major changes in the over all plans for the game.

 Will get back with results, but like I said earlier the players rating is already at 3500 when in vehicle leaving 'grudge' town, but his side is at enemy till he disembarks, but will tell in a moment.

 Thanks Triggerhappy

Mr.Pibb

  • Guest
 Sorry, but as I suspected it just added the rating to the player, ended up with 103500 and still was enemy side, dont think there is a way around this.
 Got one more test to see if I can refer the player in a trigger condition and maybe use it if it works to stop 'enemy' player vehicles from not activating crucial triggers, but i might just go with set captive.
 Going to just call this one solved, enough of our time wasted here.

 Thanks for the help, I do still intend to put this out on the Beta testing to have it availiable to public, and I will state the vehicle bug and how u have to get out to remove 'enemy' status along with triggers set to 'player' also if that works to cover 'enemy' vehicles, and also will release 'setcaptive' version if that goes ok too.

 If by some chance u or someone comes up with something that does seem to work, maybe just email me, but I just dont want this topic to linger on for days like the other one did, I really need to make a decision and carry on to other stuff in the mission.

 Thanks for the help once again Triggerhapppy :)
« Last Edit: 05 Dec 2004, 21:17:08 by Mr.Pibb »

Mr.Pibb

  • Guest
 Well, lol , I just unsolved this because the wonders never cease

 I have just discovered that the stupid vehicle bug goes away after first the first time it happens lol ???

 I guess I am speaking to u Triggerhappy mostly here, cause u know whats going on with the script more than anyone (u wrote it ;) )

 Going to have to do some more testing arggghhh , but after the vehicle ran out of the radius of the first town, ya, it was still enemy, but- after running into second town as enemy and getting out, then gettin back in, all of the sudden BAM! everything worked, I drove in and out of both town radius's and it switched sides in the vehicle perfect lol

 So this is of course using the original final script, as I told u the adding of the extra rating dosent help, player is already at proper rating.

 Friggin wierd, I am very pleased to see this tho, even if I cant get rid of the bug, at least it only happens on the first drive, so it seems.

 Any ideas Triggerhappy ?

Mr.Pibb

  • Guest
 Ok

 Seems as tho if u attain 'enemy' status while not in a vehicle, then get in a vehicle the side status will never change, regardless of rating until u get out.(driving into freindly towns dont change it)
 But, if u get in vehicle as a freindly and drive thro all the enemy towns u want to, side always changes like it should when rating changes while in vehicle. Weird eh?
 Also seems that it takes some time for the vehicles new side to register with freindlies, if I drive into a freindly town just after coming from a nearby enemy town(got switched from enemy to freindly) the res there will often shoot at the vehicle for like 20 or 30 seconds and then they chill. lol

 Anyhow, Triggerhappy, I suggest u check out the test mission I pbo'd. If nothing else its kinda neat and its yer script put into action.  ;)
 U can just put it in yer MP missions folder and run it, its on Kolgujev.

 There are 4 towns all set near each other and they each have a marker for their 'town radius' and also there are 2 square markers that are hint format triggers that give players side and rating when u go thro them. There are a few res per town, and u can drive right thro 'grudge' towns cause they are only soldiers and u start with a hummer.
« Last Edit: 06 Dec 2004, 15:20:12 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
will do later, busy right now

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
no addons please, i'm not gonna d/l stuff just so i can look at an example mission, thats a waste

Mr.Pibb

  • Guest
 Dam, terribly sorry bout that, accidently left 6 or so guys from the original mission on there that are Arctic- sheet sheet

 Heres the mission minus them, should be rid of all addon stuff now :)

I spent quite some time trying to figure the best way to deal with the 'vehicle' bug thing, which seems to an extent will still exist, so I decided to use a hint format to remind players to exit and enter vehicles when they leave a 'Grudge' town, only, that wasnt really enough. So, went thro and narrowed down exactly when the 'bug' is most likely to occur and set up the script to make the hint format show only when conditions are ideal for the 'bug'.

 Only thing is that its certainly added a good bit to the script, and I do intend to try increasing time on Delays and adding some more where I can. Any help in 'refining' this would be great. I have done some testing of the new additions for the hint and so far it works great, but it prolly could be better refined.
 
 Also u will prolly notice a hint format comes up that says when player has boarded vehicle, just a temp hint format that is.

 This is my first attempt at adding some ofp script to something this complex and gettting it to actually work, neat stuff, but times taking.

 As I stated earlier, u can drive thro those 2 square markers to get side and rating status, watch what it shows when u drive thro one after gettting in the vehicle as enemy and leaving the town. lol almost didnt make sense till I realized its the ofp program, not the script.

 Of course, there is also a problem with running res over, it dosent show as your kills, but I got a workaround for that, basically restricted or no driving in town centers with triggers, should be pretty easy.

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

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

#checkFriendlyKills
?(vehicle player != player):_PlayerEnteredInVehicle = true
?_Grudge:_NoPrevGrudge = false;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"
~2
goto "CheckRatingDrop"

#LowRating
player addrating -100000
_WhileInRatingCheck = (rating player)
#WhileIn
?(vehicle player != player) && _NoPrevGrudge:_playerboardsvehicle = true;hint format ["playerboardsvehicle is true"]
?player distance _center > _radius:player addrating _RatingChange;goto "vehicleBugFix"
?rating player != (_EntryRating - _RatingChange):_RatingChange = (_EntryRating - (rating player))
?rating player != _WhileInRatingCheck:_NoPrevGrudge = true
?(vehicle player == player) && _PlayerEnteredInVehicle && _Grudge:_NoPrevGrudge = true
~2
goto "WhileIn"

#vehicleBugFix
?(vehicle player != player) && _playerboardsvehicle: hint format ["Your vehicle is likely rogue status, Disembark then board vehicle to regain nuetral status", player]
_playerboardsvehicle = false;_NoPrevGrudge = true;
goto "checkIn"

 anyhow

will be around
« Last Edit: 06 Dec 2004, 05:56:19 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
odd, when i try your mission, my rating doesn't drop by 100000 when i kill a res,and i went in without a vehicle,it just drops the 1400 rating for killing them, are you sure it worked for you?

Mr.Pibb

  • Guest
 actually, since the addition of the vehicle check scripts I havent even tried going in a town not in a vehicle lol oops

 glad u spotted that, prolly a minor fix somewhere, thanks, ill post when I fix it. :)


Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
i used the old version, plus a much smaller bugfix....

Mr.Pibb

  • Guest
ummm

 u might wanna check that again, i just ran in the town area east of player start, killed a guy and player went rogue status (check map, zoom in close to yer guy a few moments after kill, his icon is red)
 
 Also, res dont respond initially real well to the change over until they actually see u as enemy, so even after killing the first guy they usually have to see u again or if u fire near them.

 I did use my original copy of the mission, ill use the one I pbo'd for ya just to be sure no errors, but it should be good.


Mr.Pibb

  • Guest
i used the old version, plus a much smaller bugfix....

Oh

Prolly want to use the one I just put up, vehicle bug fix and everything works smooth. :)

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
your bugfix only works on the first time, because it uses booleans that aren't reset when you leave
also it only tells them that they should get out. I was trying to make it so they won't have to make the guy get out,rather he will get out and back in instantly, so it is nearly unnoticeable, but it resets the side of the vehicle
« Last Edit: 07 Dec 2004, 02:35:14 by Triggerhappy »

Mr.Pibb

  • Guest
 rgr that Triggerhappy, ill be going over the script and testing it somemore over time, and any variables I used that arent being reset I will find and reset them, shouldnt be a prob. Anyhow, so sounds like ur saying that it really cant be fixed, just 'messed' with a lil. Its ok, like I said I am happy with the tests so far, Ive actually tested the script in the real mission and it really dosent seem to do anything differently as far as lag goes than the original script u had. The towns in the actual mission are spread way out, so nice thing is that as it seemed it took a lil time to register the new 'vehicle' side sometimes, in the real mission the towns are so far apart that its fine by the time u get to new town. :)
 If nothin new comes up Im gonna call this one solved for good, i mean so what, every once in a while when a player causes havok in a nuetral town after he leaves he has to get out and jump back in, considering that a hint does show when thats needed and it wont happen all too often its good enough for me :)

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
well, problem fixed, tested, and ready for you:

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

#checkIn
_driver = false
_gunner = false
_commander = false
_cargo = false
#loop
_RatingChange = 0
?player distance _center <= _radius:goto "checkFriendlyKills"
~2
goto "loop"

#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"
~2
goto "CheckRatingDrop"

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

#vehicleBugFix
?vehicle player == player:goto "checkin"
_vehicle = vehicle player
?player == driver _vehicle:_driver = true;goto "reassign"
?player == gunner _vehicle:_gunner = true;goto "reassign"
?player == commander _vehicle:_commander = true;goto "reassign"
_cargo = true

#reassign
player setpos getpos _vehicle
?_driver:player assignasdriver _vehicle;player moveindriver _vehicle;goto "checkin"
?_gunner:player assignasgunner _vehicle;player moveingunner _vehicle;goto "checkin"
?_commander:player assignascommander _vehicle;player moveincommander _vehicle;goto "checkin"
?_cargo:player assignascargo _vehicle;player moveincargo _vehicle;goto "checkin"
goto "checkin"

Mr.Pibb

  • Guest
 :o

holy...  wow, great, er, um, thanks, big time
wil give it a go :)


Mr.Pibb

  • Guest
 wow

 Seems you have pulled it off again  ;)

 havent done any extensive testing yet, but I can tell u that ofp is running right now and my hummer sits in a freindly town next to some res after leaving a 'grudge' town and never got out, and their not firing at me!  ;D
 saw the vehicle switch on the map and all, awsome job there Triggerhappy, really thought it wasnt gonna happen.
 Only got an hour to test lol which goes by fast, but hopefully it holds in all aspects. This is great, will feel confident about putting this up on beta testing for release as an addon to be credited to u if it all keeps as it seems.
 
 cool cool cool

 Ill post one more time tonight after testing some more to give some finals.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
just so you know, when it tested it out, i went back and forth between 2 towns, with the third "grudge" town in the middle, and i stopped at each for about 30 sec right in front of people. did that back and forth a bunch, and only the middle shot at me

Mr.Pibb

  • Guest
 ya, it all looks good. Thanks for the testing, tried to make it as easy as possbile. There does seem to be a 'bug' with ofp still that very seldom  causes other res to register player as enemy even tho everything is good, I dont think the script can get any better, the rating and side both change at appropriate times. Weird thing was one time testing, I killed everyone in the first town, then drove from there S thro the next town (all side ratings were right) and stopped at the last third town next to the res, as freindly. Got out and after bout 10 seconds all the sudden they smoked me! lol
I wasnt even expecting it, so I didnt get a close look at the icon for player after I got out, everything was a green in vehicle comin in.
 I simulated the exact events that led to that afterwards and nothin, they didnt attack. If it is in the script pretty sure I can prolly find it as time wears on anyhow, but I dont think its the script.
 So I do think there is some sort of ofp bug that  has a slim chance of the res still hating u even after going solid freindly.
 Anyhow big thanks on the script, unless there is anything else to add here, tommorow Ill call it solved.
 
 Hats off too ya Triggerhappy, nice to see it pan out. Now I have to remove the 'getting out of vehicle' part in the breifing  wew'
 
 
« Last Edit: 07 Dec 2004, 04:38:09 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
nothing i can add, but i did have that problem once as well, just ofp, no other explaination, its random. and no problem.  ;)

Mr.Pibb

  • Guest
Alright then. :)

Case closed.

Thanks again Triggerhappy