Home   Help Search Login Register  

Author Topic: check if any1´s dead (Newbie Q)  (Read 1269 times)

0 Members and 1 Guest are viewing this topic.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
check if any1´s dead (Newbie Q)
« on: 09 Feb 2003, 14:04:56 »
Hi! HereÂ's a newbie Q. Plz help:

I want to check if any1Â's dead in west side and a certain action will happen. I want to do this over and over again untill I reach 30 dead men. IÂ've tried to search and look at tutes but no luck. Plz help.

Thx in advance.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:check if any1´s dead (Newbie Q)
« Reply #1 on: 09 Feb 2003, 14:57:16 »
if its specific dudes that matter look at the alive command (combined with not, perhaps, as in "not alive)

if its numbers look into the "count" command.   you can use it on groups, west soldiers ina specific area via thislist in a trigger, or use logic to add up the numbers inseveral groups or whatever you like

(count units group1) + (count units group2) < 9

or whatever, check the syntax, spelling and everything else.    you can use this in the condition field of a trigger or in a script, which you will probably want to loop.    If you're not sure about loops it came up in this forum a couple of days ago or check Johan Gustafsson's excellent scripting tutorial.    The whole count thing came up the other day too, so try a forum search.
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:check if any1´s dead (Newbie Q)
« Reply #2 on: 10 Feb 2003, 10:03:41 »
hmm.. maybe I could come up with a script for that

create a file called dead.sqs in you mission folder

execute in some units init field with   [] exec "dead.sqs"

put this in the dead.sqs file:

_startamount = 0
_deadamount = 0
_startamount = west countside

#start

_difference = 0
_deadamount = west countside
_difference = _startamount - _deadamount

?_difference > 29: goto "exit"
~3
goto "start"

#exit
hint "more than 30 dead on west side!"
exit



who knows, maybe it will even work. try it out  ;)
Not all is lost.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:check if any1´s dead (Newbie Q)
« Reply #3 on: 10 Feb 2003, 12:52:51 »
no wsay ur script works Artak sry  :-\


Code: [Select]
_deadamount = west countside
west countside wat ?

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:check if any1´s dead (Newbie Q)
« Reply #4 on: 10 Feb 2003, 12:55:59 »
 ;D

ok so make a trigger covering the whole area where the action takes place and take the value with west countside thislist.  :D

Don't blame me for my screw ups. do something about it!  ;D
Not all is lost.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:check if any1´s dead (Newbie Q)
« Reply #5 on: 10 Feb 2003, 12:59:42 »
ur script is f00ked up - it count how meny west ppl dere r dere - not how meny dead ppl  :P

but i dont wanna help armstrong from personal reasons  ::)

*tries 2 use hipnotizin in armstrong

go and try ma misions

* hopes it helps and stops

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:check if any1´s dead (Newbie Q)
« Reply #6 on: 10 Feb 2003, 13:05:37 »
If the mission has 100 west people at start then when it has 70 it means 30 are dead right? so it does work?

I will try this when I get home, then we'll know. I just made it because it's so boring here at school.  :P


Quote
but i dont wanna help armstrong from personal reasons
Maybe you should think about it this way - You don't help Armstrong, but the entire OFP community, with your comments and opinions.

I'm not really sure if the script will work or not but I'm just making a point of view which may have someone thinking and then solve the problem in some other way.
« Last Edit: 10 Feb 2003, 13:08:28 by Artak »
Not all is lost.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:check if any1´s dead (Newbie Q)
« Reply #7 on: 10 Feb 2003, 13:07:12 »
no cuz da start amount dere is 0 :P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:check if any1´s dead (Newbie Q)
« Reply #8 on: 10 Feb 2003, 13:10:38 »
Quote
_startamount = west countside
it's set to 0 but then we have this line right after it... which you already pointed out does nothing, but which I replied then that you should
Quote
ok so make a trigger covering the whole area where the action takes place and take the value with west countside thislist.
Not all is lost.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:check if any1´s dead (Newbie Q)
« Reply #9 on: 10 Feb 2003, 13:13:59 »
right ;D didnt look enough on da script  ::)

but den u dont have 2 put it 0 @ da start :P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:check if any1´s dead (Newbie Q)
« Reply #10 on: 10 Feb 2003, 13:17:14 »
I thought you had to 'format' every variable before they can be used in storing a number  :P  Thanks, LCD it saves me some work now that I know I don't have to do that  :D
Not all is lost.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:check if any1´s dead (Newbie Q)
« Reply #11 on: 10 Feb 2003, 13:54:45 »
ok....... Not that I understand anything you are talking about but, ehm, thanks...... :-[

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:check if any1´s dead (Newbie Q)
« Reply #12 on: 10 Feb 2003, 15:53:40 »
 :) if you don't understand, then ask .... we're glad to help.

But if you have no idea where to start then spend some time with Johan Gustafsson's scripting tutorial in the Ed Depot and then have a look at the command reference to get to grips with the commands that have been mentioned.

If it still doesn't make sense ... ask.

The summary of the answers so far is that Artak tried to make you a script.    LCD kindly pointed out that it wouldn't actually work.     The basic structure of the script is fine, but it needs some work on the details.     Which is your job.

But hey, if you get stuck, ask.
Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:check if any1´s dead (Newbie Q)
« Reply #13 on: 10 Feb 2003, 16:22:40 »
Ok then. Thx everyone

*Topic solved and locked(for now)*
« Last Edit: 10 Feb 2003, 16:22:56 by The real Armstrong »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:check if any1´s dead (Newbie Q)
« Reply #14 on: 10 Feb 2003, 17:19:09 »
actually I just spend 3 hours on it and came up with a working solution.

I'm not encouraging to copy/paste but here it is if you want it quickly.




Make two triggers covering the whole area of your mission

activate by west present

1st trigger
condition: this
on activation: startamount = west countside thislist; [] exec "dead.sqs"

2nd trigger
make this activate 'repeadetly'
condition: trig2
deadamount = west countside thislist


then make a file called dead.sqs
put in that file the following:

#start

~3

trig2=true

~1

_difference = 0
_difference = startamount - deadamount

?_difference > 29: goto "exit"

trig2=false
~3
goto "start"

#exit
hint "more than 30 dead on west side!"
exit



and that's it. Any questions, don't hesitate to ask.
Not all is lost.