doTouch

Post your scripting questions / solutions here

Moderator: Moderators

Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

doTouch

Post by Krane »

I'm havin some problems w/ doTouch in my trigger...I want a trigger that is activated only when someone is inside. When the player gets out, the stuff stops...In, stuff...Out, no stuff...

Can somebody help? :)
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

if(istouching) is what you're looking for, dunnoi the syntax, try looknig at a stock map.

i think, not sure, but think it's like this...

if($player istouching $trigger)
{
//blah blah blajah
}
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
diego
Captain
Posts: 245
Joined: Sun Dec 21, 2003 10:47 pm

Post by diego »

I don't know anything about this dotouch, but what is wrong with using a trigger >multiple? My scripting knowlege is very basic. But this does do what you are talking about:

If I'm inside the trigger multiple, I take damage, or activate an alarm. If I'm outside the trigger, nothing happens.
Diego
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

Yes a trigger_multiple will work 100 times better, and I can't even find (or heard of) a doTouch, oh wait that's probably a scripty thingy.
Image
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post by fuhrer »

can u use isinside?, but u would need a trigger multiple
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

A trigger multiple activates a thread. When you leave the trigger, the thread continues. we have to use istouching w/ the trigger multiple.
Image
User avatar
diego
Captain
Posts: 245
Joined: Sun Dec 21, 2003 10:47 pm

Post by diego »

Maybe it would help if you told us exactly what you wanted to happen when you are inside the trigger? I still don't see why a trigger multiple won't help you. If you leave the trigger, the thread is no longer being called.
Diego
The French Tourist !
Lance Corporal
Posts: 17
Joined: Mon May 17, 2004 11:31 pm
Contact:

Post by The French Tourist ! »

When you want to be hurted while being inside a trigger_multiple, use the command volumedamage. This command is only available when you are inside the trigger.
A trigger doesn't have to activate a thread. Il does if you enter the key/value : setthread/mythread. But you can use this syntax :

main:

level waittill spawn

thread mythread

end

// Thread

mythread :

$mytrigger waittill trigger
$mytrigger volumedamage 10

loop:
// Commands for the alarm
while ( $player istouching $trigger )
{goto loop}

end
The French mapping is like the French kiss : the BEST one !
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

while

Post by tltrude »

Use a "while" loop.
Tom Trude,

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

wooo! lots of ideas....

while($player istouching $trigger)
{

//blah blah
}
right tltrude?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

lizardkid wrote:wooo! lots of ideas....

while($player istouching $trigger)
{

//blah blah
}
right tltrude?
To some extent, yes... but you need to get ahold of the player as well: and just writing $player is not enough as that will be an array of players...

This can all be done, but depending on what you want to happen it will be done in different ways. So Krane: can you tell us what you want to do with it? Just in a very non-technical way... what are you aiming for?
Admin .MAP Forums
Image
Head above heels.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

i found DoTouch, in g_allclasses...

doTouch( Entity touchingEntity )


sent to entity when touched.

it is not fake nor a weird unknown command! *using valient voice*
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

local.player = parm.other
while (1)
if (local.player isTouching $trigger)
{
}
else
{
end
}
end

//you need all that crap otherwise the second time the trigger is touched what ever happens to local.playe will happen twice then 3 times etc... etc...
hope this helps, prob not cos it's all foreign 2 me :-/
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Ah, now it's clear :wink: !

We need the while on top!

Txs m8!
Image
The French Tourist !
Lance Corporal
Posts: 17
Joined: Mon May 17, 2004 11:31 pm
Contact:

Post by The French Tourist ! »

Well. But be careful with while(1) because it makes an infinite loop, so u must quit the loop when the player does not touch the trigger anymore.
The French mapping is like the French kiss : the BEST one !
Post Reply