Home   Help Search Login Register  

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

0 Members and 1 Guest are viewing this topic.

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"