Scripting questions

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

Hey guys, ok ive gotten a lot better at my scripting thnx to all of you who helped. But heres a relativly simple question... how do I make it so that my trigger turns off right after it is activated? like heres an example...

Thread name:

$Object Trigger waittill trigger
-- De-Activate trigger --
$Object loopsound lighthouse_run
$Object moveup 123
$Object waitmove
$Object stoploopsound

-- Re-Activate trigger --
$Object Trigger waittill trigger
-- De-Activate trigger --
$Object loopsound lighthouse_run
$Object movedown 123
$Object waitmove
$Object stoploopsound

goto Thread name
end

kinda like that so the Object dosnt go down after a certain time, only when the user wants it to... any ideas?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

trigger

Post by tltrude »

You have to use the targetname of the trigger, not the bridge.

Thread_name:

$object_trigger waittill trigger // Wait for trigger event
$object_trigger nottriggerable // Turns it off
$Object loopsound lighthouse_run
$Object moveup 123
$Object waitmove
$Object stoploopsound
$object_trigger triggerable // Turns it on

$object_trigger waittill trigger // Wait for trigger event
$object_trigger nottriggerable // Turns it off
$Object loopsound lighthouse_run
$Object movedown 123
$Object waitmove
$Object stoploopsound
$object_trigger triggerable // Turns it on

goto Thread_name

end

A trigger does not really need to be turned off, if your thread has the "waittill" lines--because nothing can happen until the thread gets to those lines. And, the "waitmove" stops the thread until the move is done.
Tom Trude,

Image
m4rine
Major General
Posts: 714
Joined: Fri Apr 11, 2003 5:28 pm
Location: UK

Post by m4rine »

bighoss wrote:You cant use func>rotating_door to make the bridge to rotate up. It doesnt work. You have to use script to make something rotate up or down.
no u don't just use key/rotatez value/360 (or whatever speed)
"We must become the change we want to see in the world" (Mahatma Gandhi)
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Re: file type

Post by Master-Of-Fungus-Foo-D »

tltrude wrote:Under "File Type" in Windows you can change what program is used to open .scr files (Notepad or Wordpad). Also in Winzip, you can uncheck the option for automatically installing screensavers.
where the HECk is file type?(yes i have win(xp))
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

folder options

Post by tltrude »

It is in any open window under Tools > Folder options.
Tom Trude,

Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

thanx :)
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

in the Control Panel > Folder Options > File Types

When you click on the "file types" tab you may need to wait 5 - 10 seconds while it pulls up every single file type it can find. But all you have to do is go to the SCR file type and change what ever you want (i would suggest not messing with any of the other file types)

And thanx for the help Tom.

Oh, heres another question, how do I make

Script>Object
Key: targetname
Value: B3

RotateX 90? stop, wait 10 seconds, rotateX 90??Any help would be great thnx.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

script

Post by tltrude »

You whould have to script it, if it is up and down.

Code: Select all

B3_mover:

     $B3_trigger waittill trigger
     $B3 rotateXUp 90
     $B3 waitmove
     wait 10
     $B3 rotateXDown 90
     $B3 waitmove
     goto B3_mover

end
That will work, if the trigger_use is targetnamed "$B3_trigger". The thread would have to be started under prespawn with "thread B3_mover".
Last edited by tltrude on Wed Aug 25, 2004 6:52 pm, edited 1 time in total.
Tom Trude,

Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

well its not rotating up or down, i basically want it to spin around a center axis. so it basically like a door but I want it o work off of a trigger insetad of walking up to it and opening it like a door. An example would be that its a brush 128units high, 8 units wide, 64 units long that is a Func>Rotating Door but there is no origin on the sides so it just spins around its center. Thats pretty much what I want it to do but i want it on a trigger. any help?
Last edited by HDL_CinC_Dragon on Wed Aug 25, 2004 7:08 pm, edited 1 time in total.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

spin

Post by tltrude »

Code: Select all

B3_spin: 

     $B3 rotateYup 90 
     $B3 waitmove 
     wait 10 
     goto B3_spin 

end 
If "Y" does not work, try "X" or "Z". As you can see, I can't help much without information.
Tom Trude,

Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

as you were posting that i edited my thing up there^ so read that, i elaborated on it.
Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

well its not rotating up or down, i basically want it to spin around a center axis. so it basically like a door but I want it o work off of a trigger insetad of walking up to it and opening it like a door. An example would be that its a brush 128units high, 8 units wide, 64 units long that is a Func>Rotating Door but there is no origin on the sides so it just spins around its center. Thats pretty much what I want it to do but i want it on a trigger. So its not like a bridge its more like a door.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

door

Post by tltrude »

The func_rotatingdoor can do that, if you set the AUTO_OPEN spawnflag (one of the little check boxes). AUTO_OPEN causes the door to open when a player is near instead of waiting for the player to use the door. You can also add key/value "wait 10" to delay closing.
Tom Trude,

Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

ya i know the func door thind and the auto_open but I want the thing to act on a trigger.
Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

ok, heres another problem, my map isnt working! I put the .BSP in my DM folder and my .SCR is in there too. I checked my spelling in the script and i check my spelling in the the script object properties and every thing is spelled right and all the value match the script and every thing. here is what my script looks like...

Code: Select all

Main:

Thread B1_Control
$B1 time 10

Thread B2_Control
$B2 time 10

Thread B3_Control
$B3 time 5

end

B1_Control: 

$S1 waittill trigger
$S1 nottriggerable
$B1 loopsound lighthouse_run 
$B1 moveup 352 
$B1 waitmove 
$B1 stoploopsound 
$S1 triggerable

$S1 waittill trigger
$S1 nottriggerable
$B1 loopsound lighthouse_run 
$B1 movedown 352 
$B1 waitmove 
$B1 stoploopsound 
$S1 triggerable

goto B1_Control 
end

B2_Control: 

$S2 waittill trigger
$S2 nottriggerable
$B2 loopsound lighthouse_run 
$B2 moveup 352 
$B2 waitmove 
$B2 stoploopsound 
$S2 triggerable

$S2 waittill trigger
$S2 nottriggerable
$B2 loopsound lighthouse_run
$B2 movedown 352
$B2 waitmove 
$B2 stoploopsound 
$S2 triggerable

goto B2_Control 
end

B3_spin:

$B3 rotateY 90
$B3 waitmove

wait 10

$B3 rotateY 90
$B3 waitmove

goto B3_spin
end
Did i do something wrong? PLZ help!
Image
Post Reply