Jump to content
Sign in to follow this  
celery

Crashing own plane earns points

Recommended Posts

I'm making a deathmatch where you spawn into a createvehicled Camel. The map itself is done already but one bug remains: when you crash your plane without the aid of an opponent, you get points for destroying an air target and so the worst pilots come on top of the score list.

The pilots are on east side and they get moved into CamelE at spawn. Below is the script responsible for it:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#start

player addrating (-(rating player)-100000)

;CAMEL SPAWN

_camel = "Camel2" createVehicle [0,0,0]

_camel setpos [getpos player select 0,getpos player select 1,200]

_rand1=-10+random 20;

_rand2=-10+random 20;

_camel setvectordir [_rand1,_rand2,0]

_dir = direction _camel

_speed = 30

_camel setVelocity [(sin _dir*_speed),(cos _dir*_speed),0]

_camel removeweapon "TwinVickers"

_camel removeweapon "CamelGrenades"

_camel removemagazine "500Rnd_TwinVickers"

_camel removemagazine "6Rnd_Grenade_Camel"

_camel addmagazine mag

_camel addweapon gun

_camel selectweapon gun

player moveindriver _camel

_camel lock true

;END CAMEL SPAWN

?cutscene!=1:titlecut ["", "black in", 1]

#deadcheck

?!alive player : goto "dead"

~0.1

goto "deadcheck"

#dead

~5

?cutscene!=1:titlecut ["", "black faded", 1]

@alive player

goto "start"

There has to be some fix or workaround. While I'm asking, it would be nice to have an option of adding 100 score for every downed opponent, but I'm at a total loss how to do it.

Share this post


Link to post
Share on other sites

I found out that the "renegade" rating of the player makes all destroyed objects count as justified kills, the devs should look into that. I managed to meditate on the matter and made a very sophisticated score checking action into the script that deducts all airplane kills, leaving only killed pilots to affect the score.

Yeehaw! yay.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_scorenow = (score player)

scorethen = 0

_points = (_scorenow - scorethen)

#start

player addrating (-(rating player)-100000)

;CAMEL SPAWN

_camel = "Camel2" createVehicle [0,0,0]

_camel setpos [getpos player select 0,getpos player select 1,200]

_rand1=-10+random 20;

_rand2=-10+random 20;

_camel setvectordir [_rand1,_rand2,0]

_dir = direction _camel

_speed = 30

_camel setVelocity [(sin _dir*_speed),(cos _dir*_speed),0]

_camel removeweapon "TwinVickers"

_camel removeweapon "CamelGrenades"

_camel removemagazine "500Rnd_TwinVickers"

_camel removemagazine "6Rnd_Grenade_Camel"

_camel addmagazine mag

_camel addweapon gun

_camel selectweapon gun

player moveindriver _camel

_camel lock true

;END CAMEL SPAWN

?cutscene!=1:titlecut ["", "black in", 1]

#check

_scorenow = (score player)

_points = (_scorenow - scorethen)

?(_points > 0) or (_points < 0) : goto "score"

?!alive player : goto "dead"

~0.1

goto "check"

#score

?_points >= 10 : player addscore -10

_points = (_scorenow - scorethen)

?_points >= 5 : player addscore -5

scorethen = _scorenow

goto "check"

#dead

~5

?cutscene==1:goto "dead"

titlecut ["", "black faded", 1]

@alive player

goto "start"

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×