Home   Help Search Login Register  

Author Topic: Status/Fire commands?  (Read 2513 times)

0 Members and 1 Guest are viewing this topic.

1stJemHadar

  • Guest
Status/Fire commands?
« on: 21 Aug 2002, 19:41:52 »
Okay, so I have an idea for a mission that I want to make.
The Resistance begins at the foot of a hill. The soldier is alone. On the top of the hill, is a large building. It is the Russian embasy. Two soldiers stands guard outside the embassy doors. These soldiers have orders to defend themselves, but not to enitiate hostilities. In other words, I want them to stand in attention and hold their grounds when the resistance member comes in sight. I do not want them to start fireing until the resistance member fires, or enters the building. His mission is to kill the someone important, I don't have that part of the mission fully figured out yet. Anyway, the problem is, that everytime I get within site, the two guards kill me. Or, they don't do anything, not even when I starts shooting at them. I've tried all the settings I could think of, but it simply won't work.
Any suggestions.



Summerize:
I want to Russian soldiers to fire back, if fired upon. But they may not start fireing before fired upon. They must also stand up all the time, until fired upon. They may not lie down.

Thanks.

mikeb

  • Guest
Re:Status/Fire commands?
« Reply #1 on: 21 Aug 2002, 19:55:19 »
If you set the soldiers behaviour to safe then they look how you want them to look.  Correct?

Then if from the beginning you are setcaptive true.  Then they won't fire at you.  What I've noticed is that they do become agitated if fired at i.e. they drop or move or take their rifles of their backs etc.

So, create a trigger with the condition in a trigget that activates when thir behaviour is NOT set to safe.  So when you fire and they react, you can setcaptive False and they will fire back.

Entering the building is easier as you just change the captive setting when resistance (or the soldier if you group it to him) is present.

1stJemHadar

  • Guest
Re:Status/Fire commands?
« Reply #2 on: 21 Aug 2002, 20:08:11 »
Thanks.
I'm a little uncertain, though, how to make a trigger that is activated when the guards changes from "safe" mode. How do I do that?

mikeb

  • Guest
Re:Status/Fire commands?
« Reply #3 on: 21 Aug 2002, 20:12:31 »
Ummm... just reached my limit of expertise.

The condition is:

behaviour UNITNAME

This returns the behaviour value and apparently "!" means NOT.

So use behaviour UNITNAME !== "safe"

I think that's how you're meant to do it.  Again if anyone else is out there who knows more about all this then stop watching and give us a hand!!!

mikeb

  • Guest
Re:Status/Fire commands?
« Reply #4 on: 21 Aug 2002, 20:14:37 »
By the way, I just read my previous posts and I apologise for all the spelling mistakes, etc.  I know it never helps!

1stJemHadar

  • Guest
Re:Status/Fire commands?
« Reply #5 on: 21 Aug 2002, 21:13:43 »
Thank you very much!! :D

I played around a little with the commands, and got it to work.
Now I can start the real work on my mission :D

The script, if anyone is interested:
Quote
_Player = _this select 0
_GuardI = _this select 1
_GuardII = _this select 2

_Player setCaptive true

#Loop

?! (behaviour _GuardI == "SAFE") : goto "Attack"
?! (behaviour _GuardII == "SAFE") : goto "Attack"

~0.005

goto "Loop"

#Attack

_Player setCaptive false

EXIT
« Last Edit: 21 Aug 2002, 21:14:23 by 1stJemHadar »

mikeb

  • Guest
Re:Status/Fire commands?
« Reply #6 on: 21 Aug 2002, 21:21:19 »
You're welcolme.  glad to finally answer a post and actually solve the problem!!!

 ;) M

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Status/Fire commands?
« Reply #7 on: 22 Aug 2002, 06:20:33 »
Welcome to the new forums guys...

Instead of a script, you could use a trigger to accomplish exactly the same thing:

unit's init field or init.sqs

beh = "SAFE"

Trigger

Radius: 0,0
Condition: none
Condition Field: "behaviour _x != beh" count [guard1, guard2] > 0
Onactivation Field: player setcaptive false

Does much the same thing, without the need for a script.

Entirely up to you which one to use, the advantage of this being that you can add more units to the bold array up there, and it will detect if any of them are alarmed also

1stJemHadar

  • Guest
Re:Status/Fire commands?
« Reply #8 on: 22 Aug 2002, 12:09:50 »
oh, wow, that's great. This second method will certainly come in handy when I create the [important person's] personal guards.

Thanks :)

Killer Angel

  • Guest
Re:Status/Fire commands?
« Reply #9 on: 26 Aug 2002, 07:55:32 »
But how do you make the guys stand (cant lie down), and cant move. Its for a normandy mission im makin, and the MG42 gunners in the bunkers always lie down.

mikeb

  • Guest
Re:Status/Fire commands?
« Reply #10 on: 26 Aug 2002, 13:45:12 »
this setunitpos "up"

.... stops them from going prone.  You can also set "down" and I think "auto" (default)

mikeb

  • Guest
Re:Status/Fire commands?
« Reply #11 on: 26 Aug 2002, 13:45:46 »
... and this disableAI "move"...

stops them from moving