Home   Help Search Login Register  

Author Topic: Guy to shoot a flare several times w/ out rearming  (Read 641 times)

0 Members and 3 Guests are viewing this topic.

Sophion

  • Guest
Guy to shoot a flare several times w/ out rearming
« on: 09 Jul 2004, 16:22:48 »
I was trying to see if it is possible to have a yellow flare to be shot repeditly 24 times or for 10 min by one guy (Without rearming)
I tried this:

Code: [Select]
Trigger1
Activation/Timout: 12, 12, 12/ Repeditly
OnActivation: MAN fire ["M203muzzle", "FlareYellow"]
OnDeactivation : MAN AddMagazine "FlareYellow"

But the guy stoped after three rounds, so I tried 'Trigger1' without the OnDeactivtion Field and made another trigger:

Code: [Select]
Condition: MAN Fire ["M203muzzle", "FlareYellow"]
OnActivation: MAN AddMagazine "FlareYellow"

But I kept etting an error on the Condition field

HELP ME BEFORE I THROW THE COMPUTER OUT A FIVE STORY WINDOW!

Dubieman

  • Guest
Re:Guy to shoot a flare several times w/ out rearming
« Reply #1 on: 09 Jul 2004, 16:55:43 »
Don't throw your computer out the window, it might land on someone. :D


I've never done this before, but I think a script is needed instead of messing with trigggers. By the way that trigger wouldn't work anyway. The condition field is a place where it says how the trigger is activated like  NOT ALIVE captain or the customary "this".

Find the correct name of the m203 launcher first. I think its "M16GrenadeLauncher".

Then you need to script it I suppose.

Code: [Select]
_gman = _this select 0
#flare
;not sure here, I've never done this before
_gman fire ["M16GrenadeLauncher", "FlareYellow"]
~3
_gman addmagazine "FlareYellow"
~4
? flareoff = false : goto "flare"
exit


Alright I dunno if that will work but now you have to put in a tirgger and make it set off by something like a radio Alpha. In the activation field put flareoff = true. Then your script will stop.

Hopefully... :P


Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Guy to shoot a flare several times w/ out rearming
« Reply #2 on: 09 Jul 2004, 17:03:56 »
Right, the first thing to do is get a handle on what the various fields of a trigger are for.   Head over to the Ed Depot and read through a couple of trigger tutorials, or the triggers section of the general tutes.

If a sequence of definite events - for example firing 24 flares - can be traced back to one root cause then you do usually need a trigger to start it.   However, the trigger's job is to detect the conditions required for the firing to start, and to make it start, and that's all.   Once everything is up and running the trigger's part is finished.

You can make the firing happen using either a little script or some gamelogic waypoints.    In either case the commands will be much the same, its just a question of how you give them to the game.   Which is the better method is a question of circumstance and your own level of knowledge in the relevant areas.

If it was a script it might look something like this:-

; this script fires the yellow flares

_i=1

#loop
loon1 fire "flareYellow"
loon1 addMagazine "flareYellow"
_i=_i+1
? _i > = 24 : exit
~12
goto "loop"
exit


That's not meant to be a working script, its just a sketch.   If you are not familiar with scripts read Johan Gustafsson's Scripting Guide and also snYpir's Friendly Intro to Code Snippets.   If you're not familiar with gamelogics read the tute in the Pending section of the Ed Depot.

Think about the player in all this:  will he see the loon firing all these flares and wonder where he's getting them from?   What happens if the loon is killed?


Edit:  a word about the command "fire".    It comes in two versions, one simple and one more complex.  I've used the simple one here, but it doesn't work for everything and sometimes you need the complex one.   One of the arguments is "muzzle" and M203 seems to be working for you.    "M16GrenadeLauncher" is the name of the weapon which isn't the same thing as muzzle.   Although of course with some weapons it might be.   Which is why I stick to the simple version as much as possible.
« Last Edit: 09 Jul 2004, 17:14:18 by macguba »
Plenty of reviewed ArmA missions for you to play

Dubieman

  • Guest
Re:Guy to shoot a flare several times w/ out rearming
« Reply #3 on: 09 Jul 2004, 19:00:52 »
Yeah, I got the M16grenadelauncher from a basic guide, I wasn't sure if it worked or not. :P

M203muzzle worked? I've never seen or heard that name before. ???

Good luck man, Macguba's script goes far beyond mine. Use his.

Sophion

  • Guest
Re:Guy to shoot a flare several times w/ out rearming
« Reply #4 on: 09 Jul 2004, 22:58:26 »
<!> Note: M203muzzle was just shorthand <!>

Use a script instead of trigger. Hmm... (@#$%ed menu, fix the 'expandible' menu please!) So, let me see if I have it straight

1) Put a unit on and name him M1
2) Put a trigger:
Code: [Select]
Timeout: [.1][.1][.1] (start when game starts)
On activation: [M1] exec "Script.sqs."
3)Create a script named "Script.sqs":
Code: [Select]
; flare script

_M1 = _this select 0

#loop
M1 fire "FlareYellow"
~2
M1 AddMagazine "FlareYellow"
~3
goto "loop"
? Flare=true
exit

4)Create another trigger to stop script

Code: [Select]
[East], {Detected by west}
On activation: Flare=False; PlaySound "Alarm"; Cuttext ["Enemy Spoted!", "PLAIN DOWN"]

My Mission: Make a Nam style night that gets attacked by east. M1 is one of the guards and needs the flares to see in the night (like the rest of the guards). after seeing an enemy soldier he stops shooting flares (they give his position away) and sounds the alarm. The rest is in my hands (your a man that can't sleep that night).
« Last Edit: 10 Jul 2004, 02:26:16 by Sophion-Black »

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Guy to shoot a flare several times w/ out rearming
« Reply #5 on: 10 Jul 2004, 03:21:41 »
You can do it with a trigger if you really want to:

A units init field or your init.sqs
fireflare = 0

Trigger

Radius: 0,0
Condition: None (repeatedly)
Condition Field: (fireflare > 0) and (daytime > fireflare)
OnActivation Field: fireflare = (daytime + (10/3600)); unit fire ["M203Muzzle","Flare","Flare"]; unit addmagazine "Flare"

To activate, use this line in a script or trigger:
fireflare = daytime

To deactivate, just set that variable back to zero:
fireflare = 0

Change the number in red to the interval (in seconds) you want the guy to wait before firing another flare. It reloads him when he fires, so he'll keep going all night if you want him to ;)




Yes, it's probably better to use a script, but not in the way you're currently doing it as it will always be activated even when it's not needed.

Anyway, the solution you use is up to you.
Happy editing :)

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Guy to shoot a flare several times w/ out rearming
« Reply #6 on: 12 Jul 2004, 03:46:39 »
Wouldn't it be possible to make a simple loop to remove all remaining flare magazines, then add them all back (say) every second or so ?  This way the loon would have an endless supply of flares without ever having to worry about whether (or when) to add them.

Just my 2.85 Aussie cents . . .



Roni