Detecting if entity has hit a wall or roof!?

Post your scripting questions / solutions here

Moderator: Moderators

Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Detecting if entity has hit a wall or roof!?

Post 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"
}
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

try putting a trigger_multiple around the area you want to test and use istouching.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

ok

Post by Elgan »

ok, wont that only detect people?
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Only people will trigger it, but you can still use it as an entity to test if it is touching something.
Admin .MAP Forums
Image
Head above heels.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

help

Post by tltrude »

Might help, if you tell us what you are trying to do.
Tom Trude,

Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

i am trying to bomb.hehe

Post 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.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

so, you want a bomb to fall through the roof, into the floor?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

oposite/.nope

Post 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
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

wow

Post 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?
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

spawning should be universal for the whole game, just put in
thing.origin x y z like,

$fire.origin 1 1 1
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

:(

Post by Elgan »

the fire just will not spawn ina coord:@
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

ok.grr. i just used a different fire model and it worked fine...ty anyways:P
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply