Home   Help Search Login Register  

Author Topic: Checking who killed and who died. Wierd.  (Read 680 times)

0 Members and 2 Guests are viewing this topic.

Offline Pellejones

  • Members
  • *
  • Yes, well... what?
Checking who killed and who died. Wierd.
« on: 23 Sep 2004, 23:03:19 »
OK I've tried my script in every way possible! I can't find what's wrong. Then again, I'm not very good at this. Duck at the forums on ofp.info helped me with the initial event handle things.

Here's the deal, I have a three side Team DM mission. What this script is supposed to do is to find out who killed who, and award each side the correct score. WestScore, EastScore and ResScore are all predefined in my init.sqs and has the value 0.

I put this in the init on the players
Code: [Select]
this AddEventHandler ["killed",{_this exec "killed.sqs"}]
Here is my script, killed.sqs

Code: [Select]
_killedguy = _this select 0
_killer = _this select 1

?(side _killer == west AND side _killedguy == east): goto "West1"
?(side _killer == west AND side _killedguy == guer): goto "West2"
?(side _killer == east AND side _killedguy == west): goto "East1"
?(side _killer == east AND side _killedguy == guer): goto "East2"
?(side _killer == guer AND side _killedguy == west): goto "Res1"
?(side _killer == guer AND side _killedguy == east): goto "Res2"
exit

#West1
WestScore = WestScore + 1
titleText ["West-East score!", "PLAIN DOWN", 0.5]
playSound "UCapture"
goto "end"


#West2
WestScore = WestScore + 1
titleText ["West-Res score!", "PLAIN DOWN", 0.5]
playSound "UCapture"
goto "end"

#East1
EastScore = EastScore + 1
titleText ["East-West score!", "PLAIN DOWN", 0.5]
playSound "UCapture"
goto "end"

#East2
EastScore = EastScore + 1
titleText ["East-Res score!", "PLAIN DOWN", 0.5]
playSound "UCapture"
goto "end"

#Res1
ResScore = ResScore + 1
titleText ["Res-West score!", "PLAIN DOWN", 0.5]
playSound "UCapture"
goto "end"

#Res2
ResScore = ResScore + 1
titleText ["Res-east score!", "PLAIN DOWN", 0.5]
playSound "UCapture"
goto "end"


;the title text at END is just for debugging

#end
~1
titleText ["false", "PLAIN DOWN", 0.5]
exit

Nothing happens when people shoot each other. If I remove the EXIT after
Code: [Select]
?(side _killer == west AND side _killedguy == east): goto "West1"
?(side _killer == west AND side _killedguy == guer): goto "West2"
?(side _killer == east AND side _killedguy == west): goto "East1"
?(side _killer == east AND side _killedguy == guer): goto "East2"
?(side _killer == guer AND side _killedguy == west): goto "Res1"
?(side _killer == guer AND side _killedguy == east): goto "Res2"

it goes directly to #West1 and then to #end, no matter who shot who.

I have no idea how to fix this. Please help!
« Last Edit: 23 Sep 2004, 23:08:16 by Pellejones »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Checking who killed and who died. Wierd.
« Reply #1 on: 23 Sep 2004, 23:20:48 »
Have you tried?:

Code: [Select]
?(side _killer == west) AND (side _killedguy == east): goto "West1"
?(side _killer == west) AND (side _killedguy == guer): goto "West2"
?(side _killer == east) AND (side _killedguy == west): goto "East1"
?(side _killer == east) AND (side _killedguy == guer): goto "East2"
?(side _killer == guer) AND (side _killedguy == west): goto "Res1"
?(side _killer == guer) AND (side _killedguy == east): goto "Res2"
exit



Planck
I know a little about a lot, and a lot about a little.

Offline Pellejones

  • Members
  • *
  • Yes, well... what?
Re:Checking who killed and who died. Wierd.
« Reply #2 on: 23 Sep 2004, 23:35:44 »
just did. I put it up like this:
Code: [Select]
#Start
?(side _killer == WEST) AND (side _killedguy == EAST): goto "West1"
?(side _killer == west) AND (side _killedguy == guer): goto "West2"
?(side _killer == east) AND (side _killedguy == west): goto "East1"
?(side _killer == east) AND (side _killedguy == guer): goto "East2"
?(side _killer == guer) AND (side _killedguy == west): goto "Res1"
?(side _killer == guer) AND (side _killedguy == east): goto "Res2"
goto "end"

bla bla

#end
~1
titleText ["false", "PLAIN DOWN", 0.5]
exit

What happened was that it skipped the entire ?(side... thing and went directly to END, as usual.
No luck.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Checking who killed and who died. Wierd.
« Reply #3 on: 24 Sep 2004, 00:15:09 »
Try it with quotes

?(side _killer == "west") AND (side _killedguy == "guer"): goto "West2"

Plenty of reviewed ArmA missions for you to play

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Checking who killed and who died. Wierd.
« Reply #4 on: 24 Sep 2004, 02:25:52 »
i've been told that EHs don't work well w/ MultiPlayer, and are really hard to get to work in the first place...

as far as the scripts, they shoulda work either way. they do for me at least... try making a simpler one and testing it, then slowly expanding it until it is full script.
thats how i debug
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Pellejones

  • Members
  • *
  • Yes, well... what?
Re:Checking who killed and who died. Wierd.
« Reply #5 on: 24 Sep 2004, 11:55:31 »
OK this is what happens when i try it with quotes (" "). I get the following error when someone dies. It doesn't matter who dies or who kills, I still get exactly the same error.

'(side _killer == "guer") AND |#| (side _killedguy == "east")': Error generic error in expression

I haven't tried "mission" this in real MP. I only tested in directly in the editor!
« Last Edit: 24 Sep 2004, 11:56:25 by Pellejones »

Kammak

  • Guest
Re:Checking who killed and who died. Wierd.
« Reply #6 on: 28 Sep 2004, 06:36:01 »
Its not the EH's fault - the guy is dead...he doesn't have a side anymore.  :)

Just run separate "killed" handlers for the different sides, remove the side checks, and it should work.

EDIT: The dead guy becomes side "CIV".  Just checked it with a hint format line.
« Last Edit: 28 Sep 2004, 06:38:11 by Kammak »

Mr.Pibb

  • Guest
Re:Checking who killed and who died. Wierd.
« Reply #7 on: 25 Nov 2004, 04:47:07 »
Hello,

 Just wondered if u ever got the script running cause i am looking into some of the same stuff and I would love to see that script if it does work.