Home   Help Search Login Register  

Author Topic: Minefields  (Read 528 times)

0 Members and 1 Guest are viewing this topic.

KoniaX

  • Guest
Minefields
« on: 07 Aug 2004, 01:10:00 »
One of my missions I'm making needs a multi-purpose mindefield to "encourage" the player to go a certain way. I've already added the anti-vehicle mines, but I need some anit-personnel mines. What I want to be able to do is set up a big trigger (say, 500 by 500) and if the player steps into the trigger, I want a grenade or something to blow up right next to him. Can anyone help me out with this? I've checked the scripts at the editing center but either they don't work the way I need, or I'm completely clueless.

m21man

  • Guest
Re:Minefields
« Reply #1 on: 07 Aug 2004, 01:27:52 »
Make a gamelogic in the center of your minefield, and name it mine_logic1. Now create the little script below and name it qmine.sqs :

Code: [Select]
_pos = getpos player
_gren = "handgrenade" camcreate _pos
exit

Now, in your trigger's Condition field, add ?((player distance mine_logic1) <= 250) . Now put this exec "qmine.sqs" in the On Activation field.


Note that you could do all of this by trigger, but I prefer to keep my triggers clean and use short scripts whenever possible. Besides, using scripts makes it easier to go back later and add complex explosion effects ;D .
« Last Edit: 07 Aug 2004, 01:29:34 by m21man »

KoniaX

  • Guest
Re:Minefields
« Reply #2 on: 07 Aug 2004, 02:47:53 »
It says "Invalid "expression" for the ?((player distance mine_logic1) <= 250) part. I deleted the ? at teh start of it, and that message went away. I'm about to test it out now.

Thank you!  ;D

KoniaX

  • Guest
Re:Minefields
« Reply #3 on: 07 Aug 2004, 02:52:00 »
Ahhh! It didn't work. I went to the center of my minefield without any explosion. And I know that the trigger was activated, because I made it so that when you enter the trigger, a mesage will come up saying "you have entered the minefield". Any suggestions? Do I have to add that question mark?

m21man

  • Guest
Re:Minefields
« Reply #4 on: 07 Aug 2004, 04:19:42 »
OK, I fixed it.

Step 1: Create a trigger, activated by the player's side. In the Condition field, put:
Code: [Select]
this && (player distance mine_logic1 <= 250)
In the On Activation execute the mine script.

Step 2: Make qmine.sqs and put the following into it:
Code: [Select]
_pos = getpos player
_px = _pos select 0
_py = _pos select 1
_pz = _pos select 2
_bomb = "heat73" camcreate [_px,_py + 2,_pz]
exit

KoniaX

  • Guest
Re:Minefields
« Reply #5 on: 07 Aug 2004, 04:47:54 »
Ahhh ty! It worked perfectly! thank you thank you thank you