Jump to content
Sign in to follow this  
mrtbk

player scoring

Recommended Posts

this is the first map i have created well tried to create

i have created a map with a radio tower called 'fm', i would like to know how to give the player that destroyed the tower 50 points

i have tried placing a trigger with the condition '!Alive(fm)'

and when activated i have tried 'player addscore 50'

i have tried '_x addevenhandler ["killed", {[_this select 0] addscore 50}]'

i tried loads of ideas not work

could someone please help me

Share this post


Link to post
Share on other sites

Have you tried adding a killed eventhandler to the radio tower? If you add a killed eventhandler to the player it will execute only when the player is dead. The way you use that eventhandler it will add 50 score to itself if its killed. I think the killer is select 1 but you can check it in the wikipedia.

Share this post


Link to post
Share on other sites

i have tried putting the command on the radio tower with no luck but thank you for your input

Share this post


Link to post
Share on other sites

Zoom in on the radiotower in the editor.

Place a game logic on the radio tower and in the init put the following:

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

(getpos this nearestobject objectIDhere) addeventhandler ["Killed",{(_this select 1) addscore 50}]

Just replace "objectIDhere" with the ID you see on the radio tower.

Share this post


Link to post
Share on other sites

there is not id on the radio tower as i placed it in there but i got ti to work thank-you very much indeed biggrin_o.gif

Share this post


Link to post
Share on other sites
Keep in mind that addScore only does something in Multi-Player.

For Single-Player games you have to use addRating.

Hmm, thats good to know. so for my singleplayer map do i put

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

MinRating=0

AvgRating=1000

MaxRating=2000

in my description.ext or do i leave it as

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

MinScore = 0;

AvgScore = 1000;

MaxScore = 2000;

but change all the addscore to addrating?

Share this post


Link to post
Share on other sites

I dont know what type of mission you are making but since you get much more rating than score for killing stuff I suggest multiplying all numbers by 100-1000.

Share this post


Link to post
Share on other sites

alright thanks, i noticed that the first time i finished my mission with 26000+ points, so i upped it in my description smile_o.gif

Share this post


Link to post
Share on other sites

ok that code works fine until i start hosting the game

the only person to get points for destroying a target is me, so when some one else destroys the target they don't get any points,

When i host the game on a game server no one gets points when the target is destroyed

Share this post


Link to post
Share on other sites

im trying to figure this out myself as im part of the same group as mrt

to refresh what we have tried is all the obove but when we host the map to test only the player hosting gets the score if he blows up taget, if any other player tries they get no score,

we figured this was a glitch due to not being hosted on a dedicated server,

on hosting on a dedicated server no player at all gets any score

what we are tring to create is a multiplayer pvp A&D map with a number of targets that will give players a individual score for blowing the targets .ie player 1 blows radio tower 1 he gets 10 points ,player 2 blows radio tower 3 he gets 10 points, ect ect ,

any help would be greatly apreciated

Share this post


Link to post
Share on other sites

ok to try an explain this a bit better, i have placed a radio tower on the map and place a gamelogic ontop with the name obj1 and in the initialisation box put

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(position obj1 nearestobject "Land_Vysilac_FM") addeventhandler ["Killed",{(_this select 1) addscore 50;}

this code only seem to award points if the person hosting the game destroys the radio tower

i have also tried using a trigger with the code in the activation section with no luck

can any please help cos this driving me crazy

Share this post


Link to post
Share on other sites

i worked out why it was only working for the host, the target which was a radio tower was a target i put in and for some reason when the script was run the clients wouldn't recognise that that radio tower was the closest

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  

×