Page 1 of 1

problem with script thread

Posted: Thu Feb 24, 2005 2:39 am
by HDL_CinC_Dragon
ok, heres a thread I pulled from my script, it works except for the following things:
.:1:. $switch_01 and $switch_02 do not animate, they are both train switches but they dont go through the anim that they are supposed to.

.:2:. $warehouse_lift_01 does not loopsound or playsound "steamloop" when it is supposed to

.:3:. $generator_01 and $generator_02 do not loopsound or playsound "m6l2b_generator_run" or "m6l2b_generator_off" when they are supposed to.

those are the only 3 problems with this thread. Below is what I have in my script before level waitill prespawn. Is there something im missing? please help! thnx.

Oh, and when you see "snipers_crossing" in the alias cache area thats my maps name...

Code: Select all

aliascache lighthouse_lever sound/mechanics/M1_LeverPull.wav soundparms 1.5 0.0 0.8 0.0 160 1600 item loaded maps "m1l3c dm moh obj train snipers_crossing dm obj"

Code: Select all

aliascache m6l2b_generator_run sound/mechanics/Mec_GeneratorRun_01.wav soundparms 1.0 0.0 1.0 0.0 160 6000 item loaded maps "m6 snipers_crossing dm obj "

Code: Select all

aliascache m6l2b_generator_off sound/mechanics/Mec_GeneratorOff_01.wav soundparms 1.5 0.0 1.0 0.0 160 6000 item loaded maps "m6 snipers_crossing dm obj "

Code: Select all

aliascache steamloop sound/mechanics/Mec_SteamLoop_01.wav soundparms 1.0 0.3 1.0 0.0 320 2200 item loaded maps "m6l3c m6l3d m6l3e snipers_crossing dm obj"

Code: Select all

lift_01_ops:
while(1)
	{
		$trigger_05 waittill trigger
		$trigger_05 nottriggerable
		$switch_01 anim start
		$switch_02 anim start
		$switch_01 playsound lighthouse_lever
		$switch_02 playsound lighthouse_lever
		wait 1
		$warehouse_lift_01 loopsound steamloop
		$generator_01 loopsound m6l2b_generator_run
		$generator_02 loopsound m6l2b_generator_run
		$warehouse_lift_01 moveup 192
		$warehouse_lift_01 waitmove
		$generator_01 stoploopsound
		$generator_02 stoploopsound
		$generator_01 playsound m6l2b_generator_off
		$generator_02 playsound m6l2b_generator_off
		$warehouse_lift_01 stoploopsound
		wait 1
		$switch_01 anim stop
		$switch_02 anim stop
		$switch_01 playsound lighthouse_lever
		$switch_02 playsound lighthouse_lever
		$trigger_05 triggerable
		$trigger_05 waittill trigger
		$trigger_05 nottriggerable
		$switch_01 anim start
		$switch_02 anim start
		$switch_01 playsound lighthouse_lever
		$switch_02 playsound lighthouse_lever
		wait 1
		$warehouse_lift_01 loopsound steamloop
		$generator_01 loopsound m6l2b_generator_run
		$generator_02 loopsound m6l2b_generator_run
		$warehouse_lift_01 movedown 192
		$warehouse_lift_01 waitmove
		$generator_01 stoploopsound
		$generator_02 stoploopsound
		$generator_01 playsound m6l2b_generator_off
		$generator_02 playsound m6l2b_generator_off
		$warehouse_lift_01 stoploopsound
		wait 1
		$switch_01 anim stop
		$switch_02 anim stop
		$switch_01 playsound lighthouse_lever
		$switch_02 playsound lighthouse_lever
		$trigger_05 triggerable
		waitframe
	}
end

Posted: Thu Feb 24, 2005 7:50 am
by wacko
don't forget to put

Code: Select all

local.master=spawn ScriptMaster
before the aliascache lines like:

Code: Select all

main:
exec global/DMprecache.scr
level.script = maps/dm/snipers_crossing.scr
local.master=spawn ScriptMaster
aliascache lighthouse_lever sound/mechanics/M1_LeverPull.wav soundparms 1.5 0.0 0.8 0.0 160 1600 item loaded maps "dm obj "
aliascache m6l2b_generator_run sound/mechanics/Mec_GeneratorRun_01.wav soundparms 1.0 0.0 1.0 0.0 160 6000 item loaded maps "dm obj "
aliascache m6l2b_generator_off sound/mechanics/Mec_GeneratorOff_01.wav soundparms 1.5 0.0 1.0 0.0 160 6000 item loaded maps "dm obj "
aliascache steamloop sound/mechanics/Mec_SteamLoop_01.wav soundparms 1.0 0.3 1.0 0.0 320 2200 item loaded maps "dm obj"
level waitTill prespawn
...
level waittill spawn
...
end
...
You wrote a whole story at the end of each aliascache line. I believe, "dm obj " will be enough, because all maps in main/maps/dm and main/maps/obj would be covered then.

For the lever, it just got anim stages 'move' and 'idle', so use

Code: Select all

$switch_01 anim move
and

Code: Select all

$switch_01 anim idle

Posted: Thu Feb 24, 2005 12:32 pm
by Master-Of-Fungus-Foo-D
it has to belike this...

Code: Select all

local.master=spawn ScriptMaster
thast goes before al the alieascacheing, and you have to put local.master right before EACH aliascache.. like so,

Code: Select all

local.master = spawn ScriptMaster
local.master aliascache lighthouse_lever sound/mechanics/M1_LeverPull.wav soundparms 1.5 0.0 0.8 0.0 160 1600 item loaded maps "dm obj " 

Posted: Thu Feb 24, 2005 3:25 pm
by HDL_CinC_Dragon
Ok i added and changed the script. Im gunna test it right now...



Master-Of-Fungus-Foo-D, that sig is awesome :D
you used Paint to make each frame right?

Posted: Thu Feb 24, 2005 3:36 pm
by HDL_CinC_Dragon
ok it works except for $generator_01 and $generator_02 do not loopsound or playsound "m6l2b_generator_run" when they are supposed to. they do however playsound "m6l2b_generator_off".

One other problem is that I cant see my switch.... im making a thread in the mapping section b/c this is a mapping problem that i can find the cause or the solution... Thnx so far on your help guys =)

Posted: Thu Feb 24, 2005 4:42 pm
by Green Beret
remember all switch anim's arent always the same value

try

anim on
or anim turnon
and off would be
anim off
or anim turnoff

hope this helps,it did for me on my switches :wink:

Posted: Thu Feb 24, 2005 7:17 pm
by Rookie One.pl
All animations are listed in the TIKIs, why bother yourself trying to guess them? ;)

Posted: Thu Feb 24, 2005 10:30 pm
by HDL_CinC_Dragon
everything works :) thnx guys