Page 1 of 3
A BOX DROPPED IN YOUR HEAD
Posted: Thu Aug 12, 2004 4:25 pm
by GARRAPIGNADO
Hi all!!
I have some knowledge about mapping, but, in scripting I'm not as good. So, I have a simple question but I haven't found it in other post (maybe I didn't look good for it

)
The question is that follows:
I have a trigger (targetname switch) and a box (targetname box). I want that, when I use the trigger, the box drops (250 units down) and kills any player under it. It's for multiplayer, there's no bots. Y dont want to break the box, or have an explosion, only to drop and kill everybody under the box.
It could be possible to make a sound too? How?
Thanks all!!!!!
Posted: Thu Aug 12, 2004 5:38 pm
by MasterMind
This is how:
Code: Select all
boxDrop:
$switch wattill trigger
$switch nottriggerable
$box movedown 250
$box time .5
$box move
end
Thats it
I dont exactly know how to add sound though

I'm using a script like this for a stamper I'm making

Posted: Thu Aug 12, 2004 6:28 pm
by GARRAPIGNADO
OHHH, thank you very much!!!!!
You're my heroo, sure.
I supose that sound could be with playsound, or something like that, but not sure.
Only a cuestion: it kills automatically if I'm below?
Switch nottrigglerable makes that I can't do it again, isn't it? And .5 is the time will spend to go down, I think.
Thank you again Mastermind!!!!
Posted: Thu Aug 12, 2004 6:44 pm
by GARRAPIGNADO
Sorry Mastermind, but it dont works (in my map). I think I did something wrong:
I have the script_object, with targetname box.
The trigger_use with targetname switch (nothing else).
In my scr (it works in other functions of the map), I have included before the end of it, the line thread boxDrop
And, after the end, I copied your code. Compile, and play, but It doesn't do anything.
Have I to do something else with the trigger_use? Have I to give a setthread boxDrop in the entities inspector?
I`1Qks for your help.
Posted: Thu Aug 12, 2004 6:54 pm
by MasterMind
This should be your entire script:
Code: Select all
main:
level waittill spawn
thread boxDrop
end
boxDrop:
$switch wattill trigger
$switch nottriggerable
$box movedown 250
$box time .5
$box move
end
Is your script like this?? If not make it like this
If there are any problems tell me

Posted: Thu Aug 12, 2004 6:59 pm
by MasterMind
GARRAPIGNADO wrote:OHHH, thank you very much!!!!!
I supose that sound could be with playsound, or something like that, but not sure.
Only a cuestion: it kills automatically if I'm below?
Switch nottrigglerable makes that I can't do it again, isn't it? And .5 is the time will spend to go down, I think.
Thank you again Mastermind!!!!
Yes, you got it all right but I dont know if it will kill you right away

I'll try to find out if there is a way to make it kill you right when it touches you

Posted: Thu Aug 12, 2004 7:31 pm
by GARRAPIGNADO
One cuestion: this works in Spearhead?? I Work in these, not in Allied Assault.
(I tried your code but it doesnt work, jejejeje) Usually I'm not as dumb!
So, I'm leading a mapping/scripting/skinning forum to beginers, but this problem drives me crazy!
My code, that's your code
Code: Select all
main:
level waittill spawn
thread boxDrop
end
boxDrop:
$switch wattill trigger
$switch nottriggerable
$box movedown 250
$box time .5
$box move
end
My entities:
The trigger_use
And the script_object
I think it's all right, but is evident that's wrong
Thanks.
Posted: Thu Aug 12, 2004 7:42 pm
by MasterMind
I have another way of doing this, would you like my to show you?? Its a lot easier and I know it will work

Posted: Thu Aug 12, 2004 7:54 pm
by GARRAPIGNADO
SURE! Everything you tell me about this is like gold, jejejejejeeje.
I'm listening

Posted: Thu Aug 12, 2004 8:07 pm
by MasterMind
Alright

, make a script_object on the ground just below the box, give this script_object a texture called origin, when your finished with that give it a targetname 'bog' (it stands for box on ground). Now change your script to this:
Code: Select all
main:
level waittill spawn
thread boxDrop
end
boxDrop:
$switch wattill trigger
$switch nottriggerable
$box moveto bog 200
end
Thats it save the script and compile and it should work

Posted: Thu Aug 12, 2004 8:09 pm
by MasterMind
Forgot to tell you, make sure that the box on the ground is the same size as the box that is going to be dropped

Posted: Thu Aug 12, 2004 8:24 pm
by bdbodger
Is there anything under the box or is if hanging in the air ? If it does not move it maybe that it can't because it is blocked . One other way of doing this is to use physics .
boxDrop:
$switch wattill trigger
$switch nottriggerable
$box physics_on
$box waittill touch
$box explode 100 // or use radiusdamage
end
Posted: Thu Aug 12, 2004 8:58 pm
by GARRAPIGNADO
Posted: Thu Aug 12, 2004 11:13 pm
by MasterMind
script
Posted: Fri Aug 13, 2004 4:53 am
by tltrude
No matter which script you use, the file must be named the same as your bsp file (mapa_base.scr), and it must be in the same folder (maps/dm ? ).