Home   Help Search Login Register  

Author Topic: Defining Score/rules in MP game  (Read 1408 times)

0 Members and 1 Guest are viewing this topic.

Offline Pellejones

  • Members
  • *
  • Yes, well... what?
Defining Score/rules in MP game
« on: 28 Aug 2003, 10:58:17 »
Hello.

Here's a question.
I have a CTF map where EAST can capture WEST's flag. WEST is supposed to guard it. Nothing else.
Now, the problem is this:

The only way I want EAST to score, is by stealing the FLAG and taking it home. I dont want them to get anything for killing a WEST soldier.
5 points (or similar) for the team, when the flag is captured.

The only way I want WEST to score, is by killing the EAST troops.
1 point for the team, for each 1 enemy killed.

When the match is over (time/score limit set before start of mission), it would be nice if there was a way to show which side won. I'm guessing I should use an Outro.sqs that has a script that checks which side has the most score when the game is over, and then print it on the screen. Don't know how to do this.

Is there a way to do all this?
I havent found anything here on OFPEC or on any other site.

The other problem I need help with, is returning the flag to WEST, say 30 seconds, after the carrier has died. How do I do that?

Thanks!

Offline Mrc

  • Members
  • *
  • International man of mystery
Re:Defining Score/rules in MP game
« Reply #1 on: 28 Aug 2003, 21:34:07 »
If you really want use ingame Score feature, I can think about a solution using "killed" eventhandler and "addscore" command with negative score value. But both "killed" EH and addscore are local so you would have use some network transfer script.

Ok, as I wrote it I came to easier solution without messing with handlers ;D,  save number of flags captured into variable (maybe you'll have to send it to other comps by "PublicVariable", it depends on how you'll make it) and make loop script setting Score to (number of flags captured * 5).
You can get player's score by using "score" command and then decrease/increase it by using "addscore" to desired value). You'll have to set the score for all EAST players on every comp, because as I said, addscore is local to computer where it was envoked.

The second solution is easier to implement, because you'll only have to worry about broadcasting one variable and one loop script on each PC.
« Last Edit: 28 Aug 2003, 21:35:49 by Mrc »

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Defining Score/rules in MP game
« Reply #2 on: 29 Aug 2003, 01:59:08 »
if u use addeventhandler killed and the player is on east, then you can use something similar to the spawnkill systems that are available to see if the shooter was west and if he is

Wscore = wscore+1;publicvariable "Wscore"

or if u simply want to add a point to west every time an east player is killed, have the player who was killed add a score to the other side without checking who the shooter was

Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Pellejones

  • Members
  • *
  • Yes, well... what?
Re:Defining Score/rules in MP game
« Reply #3 on: 29 Aug 2003, 12:17:10 »
thanks!

I made the script without any help acctually. You guys took too long to reply. Didn't think I had it in me   :D It's a good thing because I learned alot from it.
What I did was create a WTime.sqs that is executed everytime an EAST soldier is killed. Then I added a trigger on the map (x:1000, y:1000) for every EAST soldier, and named the soldiers e1,e2...  the trigger works like this:

Activation: Anyone, Repeat
Condition: NOT ALIVE e1
Action: [ ] exec "WTime.sqs"

What I couldn't figure out is how to add every East soldier to One trigger. Doesn't matter tho since there's only 5 soldiers.

The script looks something like this:

;WTime.sqs

WTime = WTime + 1
?(WTime == 5): WestScore = WestScore + 1
?(WTime == 5): WTime = 0


There's more to the script. Cant remember what I looks like really. I have a bunch of texts that show up when WEST scores etc. etc. It works great! I also fixed the "Return Flag" function. I'll post the entire thing when I'm back at my own computer. If you guys want that is. Note that some of the stuff is copied from the MP Templates and changed to suit what I need.