Page 1 of 2
Detecting if entity has hit a wall or roof!?
Posted: Wed Apr 14, 2004 8:18 pm
by Elgan
--------------------------------------------------------------------------------
hello. is it possible to detect if a moving entity hits a wall or roof of a house or something?
if(istouching$bomb==1){
iprintln "touching house"
}
Posted: Wed Apr 14, 2004 8:25 pm
by lizardkid
try putting a trigger_multiple around the area you want to test and use istouching.
ok
Posted: Wed Apr 14, 2004 8:52 pm
by Elgan
ok, wont that only detect people?
Posted: Wed Apr 14, 2004 10:24 pm
by Bjarne BZR
Only people will trigger it, but you can still use it as an entity to test if it is touching something.
help
Posted: Wed Apr 14, 2004 11:47 pm
by tltrude
Might help, if you tell us what you are trying to do.
i am trying to bomb.hehe
Posted: Thu Apr 15, 2004 1:35 am
by Elgan
well i have a bomb that falls to the floor but if it is over a roof it goes through the roof..
i want to make it detect if it hits the roof and stop mooving.
Posted: Thu Apr 15, 2004 2:53 am
by lizardkid
so, you want a bomb to fall through the roof, into the floor?
oposite/.nope
Posted: Thu Apr 15, 2004 3:37 am
by Elgan
i wnat it not to go throuh the roof...so if it hits a roof it stops. but if their is no roof it hits the floor
Posted: Thu Apr 15, 2004 6:39 am
by bdbodger
What I do is do a trace from the bomb down like this
local.bottom_spot = ($airraid_speaker.origin + ( 0 0 -2048))
local.spot = trace $airraid_speaker.origin local.bottom_spot 0
local.bomb= spawn script_model "targetname" "bomb"
$bomb model "ammo/us_bomb.tik"
$bomb.origin = $airraid_speaker.origin
$bomb.angles= ( 90 0 0 )
$bomb notsolid
$bomb playsound drop_bomb
$bomb speed 800
$bomb moveto local.spot
$bomb waitmove
$bomb immediateremove
The trace gives you a spot where it hit something .
wow
Posted: Thu Apr 15, 2004 4:38 pm
by Elgan
yay i love u.lol. ok...
it works great.ty:P
ok. when i try to spawn fire...it always spawns at 0 0 0. but if i change the model wiht the same code. it spawns at the origin i gave it.. is it different for fire?
Posted: Thu Apr 15, 2004 4:55 pm
by lizardkid
spawning should be universal for the whole game, just put in
thing.origin x y z like,
$fire.origin 1 1 1
:(
Posted: Thu Apr 15, 2004 5:38 pm
by Elgan
the fire just will not spawn ina coord:@
Posted: Thu Apr 15, 2004 6:04 pm
by lizardkid
are you using
spawn models/fx/fire.tik "origin" "x y z"
???
if that's not the path then just right click for the big popup window and find the fire you want and replace fx/fire.tik with the modelname that appears in the entity properties window.
Posted: Thu Apr 15, 2004 6:49 pm
by Elgan
ok.grr. i just used a different fire model and it worked fine...ty anyways:P
Posted: Thu Apr 15, 2004 7:41 pm
by lizardkid
what fire model are you trying for? i'd like to try it out. if i get it to work ill let you know.