can i cancel the thread in scr?
Moderator: Moderators
can i cancel the thread in scr?
i making dancing room
i want make blink very fast white light
i want blink light can switch on/off
my whole idea(i know little scr commands),
1st - put trigger_multiple(named 'light1sensor') in whole map area, and make switch($blink_light1_sw) and switch trigger($blink_light1_tri) ,
2nd - on/off blink light by using triggerable and nottriggerable by switch in scr:
//----
// blink_light1_on
//----
blink_light1_on:
$blink_light1_tri waittill trigger
$blink_light1_sw time 0.14
$blink_light1_sw movedown 1
$blink_light1_sw playsound click
$blink_light1_sw waitmove
$blink_light1_sw moveup 1
$blink_light1_sw move
$light1sensor triggerable
goto blink_light1_off
end
//
blink_light1_off:
$blink_light1_tri waittill trigger
$blink_light1_sw time 0.14
$blink_light1_sw movedown 1
$blink_light1_sw playsound click
$blink_light1_sw waitmove
$blink_light1_sw moveup 1
$blink_light1_sw move
$light1sensor nottriggerable
goto blink_light1_on
end
//----
// light1sensor
//----
light1sensor:
$light1sensor waittill trigger
$blink_light1 light 1 1 1 700
$blink_light1 angles 90 0 0
$blink_light1 spot_angle 35
$blink_light1 lighton
wait 0.05
$blink_light1 lightoff
wait 0.1
goto light1sensor
end
!!!!PROBLEM!!!!! i want 'very fast blink light' but it cant be by this method
because '$light1sensor waittill trigger'(beling 'light1sensor:')
computer light slow because he check 'trigger_multiple'
i tried below:
//----
// light1sensor
//----
light1sensor:
//$light1sensor waittill trigger
$blink_light1 light 1 1 1 700
$blink_light1 angles 90 0 0
$blink_light1 spot_angle 35
$blink_light1 lighton
wait 0.05
$blink_light1 lightoff
wait 0.1
goto light1sensor
end
above method was better then before
but......but i cant on/off it!!!!
I need another method can on/off blink light
i want make blink very fast white light
i want blink light can switch on/off
my whole idea(i know little scr commands),
1st - put trigger_multiple(named 'light1sensor') in whole map area, and make switch($blink_light1_sw) and switch trigger($blink_light1_tri) ,
2nd - on/off blink light by using triggerable and nottriggerable by switch in scr:
//----
// blink_light1_on
//----
blink_light1_on:
$blink_light1_tri waittill trigger
$blink_light1_sw time 0.14
$blink_light1_sw movedown 1
$blink_light1_sw playsound click
$blink_light1_sw waitmove
$blink_light1_sw moveup 1
$blink_light1_sw move
$light1sensor triggerable
goto blink_light1_off
end
//
blink_light1_off:
$blink_light1_tri waittill trigger
$blink_light1_sw time 0.14
$blink_light1_sw movedown 1
$blink_light1_sw playsound click
$blink_light1_sw waitmove
$blink_light1_sw moveup 1
$blink_light1_sw move
$light1sensor nottriggerable
goto blink_light1_on
end
//----
// light1sensor
//----
light1sensor:
$light1sensor waittill trigger
$blink_light1 light 1 1 1 700
$blink_light1 angles 90 0 0
$blink_light1 spot_angle 35
$blink_light1 lighton
wait 0.05
$blink_light1 lightoff
wait 0.1
goto light1sensor
end
!!!!PROBLEM!!!!! i want 'very fast blink light' but it cant be by this method
because '$light1sensor waittill trigger'(beling 'light1sensor:')
computer light slow because he check 'trigger_multiple'
i tried below:
//----
// light1sensor
//----
light1sensor:
//$light1sensor waittill trigger
$blink_light1 light 1 1 1 700
$blink_light1 angles 90 0 0
$blink_light1 spot_angle 35
$blink_light1 lighton
wait 0.05
$blink_light1 lightoff
wait 0.1
goto light1sensor
end
above method was better then before
but......but i cant on/off it!!!!
I need another method can on/off blink light
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
put a setthread command in radiant
key: setthread
value: lights
key: wait
value: .4
then in the script
main:
level waittill spawn
$blink_light1_sw time 0.14
$blink_light1 light 1 1 1 700
$blink_light1 angles 90 0 0
$blink_light1 spot_angle 35
end
lights:
$blink_light1 lightOn
$blink_light1_sw playsound click
$blink_light1_sw moveDown 1
$blink_light1_sw waitmove
$blink_light1 lightOff
$blink_light1_sw moveUp 1
$blink_light1_sw waitmove
end
//this will then leave the lights off up noone is in the trigger
key: setthread
value: lights
key: wait
value: .4
then in the script
main:
level waittill spawn
$blink_light1_sw time 0.14
$blink_light1 light 1 1 1 700
$blink_light1 angles 90 0 0
$blink_light1 spot_angle 35
end
lights:
$blink_light1 lightOn
$blink_light1_sw playsound click
$blink_light1_sw moveDown 1
$blink_light1_sw waitmove
$blink_light1 lightOff
$blink_light1_sw moveUp 1
$blink_light1_sw waitmove
end
//this will then leave the lights off up noone is in the trigger
hope this helps, prob not cos it's all foreign 2 me :-/
this?
How about this???
------------------------------------
main:
level waittill prespawn
$blink_light1_sw time 0.14
$blink_light1 light 1 1 1 700
$blink_light1 angles 90 0 0
$blink_light1 spot_angle 35
level.lite_on = 0
level.blink_time = .14 // adjust blinking here
thread light_switch
level waittill spawn
end
light_switch:
$blink_light1_tri waittill trigger
$blink_light1_sw playsound click
$blink_light1_sw moveup 1
$blink_light1_sw waitmove
level.lite_on = 1
thread blinker
$blink_light1_tri waittill trigger
$blink_light1_sw playsound click
$blink_light1_sw moveDown 1
$blink_light1_sw waitmove
level.lite_on = 0
goto light_switch
end
blinker:
while (level.lite_on == 1)
{
$blink_light1 lightOn
wait (level.blink_time)
$blink_light1 lightOff
wait (level.blink_time)
}
waitframe
end
------------------------------------
It probably wont be smooth because the framerate is always changing in the game.
------------------------------------
main:
level waittill prespawn
$blink_light1_sw time 0.14
$blink_light1 light 1 1 1 700
$blink_light1 angles 90 0 0
$blink_light1 spot_angle 35
level.lite_on = 0
level.blink_time = .14 // adjust blinking here
thread light_switch
level waittill spawn
end
light_switch:
$blink_light1_tri waittill trigger
$blink_light1_sw playsound click
$blink_light1_sw moveup 1
$blink_light1_sw waitmove
level.lite_on = 1
thread blinker
$blink_light1_tri waittill trigger
$blink_light1_sw playsound click
$blink_light1_sw moveDown 1
$blink_light1_sw waitmove
level.lite_on = 0
goto light_switch
end
blinker:
while (level.lite_on == 1)
{
$blink_light1 lightOn
wait (level.blink_time)
$blink_light1 lightOff
wait (level.blink_time)
}
waitframe
end
------------------------------------
It probably wont be smooth because the framerate is always changing in the game.
Last edited by tltrude on Fri Feb 27, 2004 11:32 am, edited 3 times in total.
-
omniscient
- Major General
- Posts: 694
- Joined: Tue Sep 16, 2003 12:02 am
df
i...
i suffered
because just 'l'
waittil ->waittill
yeah....when i changed it, it worked
yeah.......thank you..
i need to know what these commands mean
while (1)
it worked fine. i changed it to:
while (level.light_on == 1)
it also worked fine. i am anxious
and i am anxious about
waitframe
thank you for reading
i suffered
because just 'l'
waittil ->waittill
yeah....when i changed it, it worked
yeah.......thank you..
i need to know what these commands mean
while (1)
it worked fine. i changed it to:
while (level.light_on == 1)
it also worked fine. i am anxious
and i am anxious about
waitframe
thank you for reading
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
while means as it says while something is happening
1 means always true
so while (1) will always run
while (level.light_on == 1)
will only run while level.light_on equals 1
waitframe... hmmm...
scripting is ran as fast as possible and if their are no wait commands you will get a command overflow error as you CPU is trying to do too much
you may of heard of FPS (frames per second) these are how many times the image will change in a second, so waitframe will only run the command, when the next frame is loaded, therefore not flooding it with commands
if fps = 24
the command will be ran 24 times in one second
1 means always true
so while (1) will always run
while (level.light_on == 1)
will only run while level.light_on equals 1
waitframe... hmmm...
scripting is ran as fast as possible and if their are no wait commands you will get a command overflow error as you CPU is trying to do too much
you may of heard of FPS (frames per second) these are how many times the image will change in a second, so waitframe will only run the command, when the next frame is loaded, therefore not flooding it with commands
if fps = 24
the command will be ran 24 times in one second
hope this helps, prob not cos it's all foreign 2 me :-/


