Door/Hatch Problem

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

Moderator: Moderators

Post Reply
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Door/Hatch Problem

Post by Shifty »

I'm having a problem with this triggered door im adding to my map, as you enter it rotates up straight away and then starts spinning :shock:

Any Ideas?

Heres the Script

Code: Select all

// doortest
// ARCHITECTURE: Shifty
// SCRIPTING: Shifty

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "doortest"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" ""
		
	level waitTill prespawn

	//*** Precache Dm Stuff
	exec global/DMprecache.scr

	exec global/door_locked.scr::lock
	level.script = doortest.scr
	exec global/ambient.scr mohdm7
	
	thread floordoor_mover
	
	level waittill spawn

end


//------------------------------------------
// floor doors
//------------------------------------------

floordoor_mover:

$floordoor time 2
$floordoor time 2

$floordoor_trigger waittill trigger
$floordoor_speaker playsound ("door_wood_open_move" + (randomint(3) + 1))
$floordoor rotateXup -90
$floordoor move
$floordoor_speaker playsound door_wood_open_stop
wait 20
$floordoor_speaker playsound ("door_wood_close_move" + (randomint(1) + 1))
$floordoor rotateXdown -90
$floordoor move
$floordoor_speaker playsound ("door_wood_close_stop" + (randomint(2) + 1))

goto floordoor_mover

end
Heres the map put in main\maps\DM

http://www.shiftysbunker.pwp.blueyonder ... ortest.zip
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post by crunch »

Get rid of thread floordoor_mover in the main script.
That should be called by the trigger. So, in Radiant, you should have your trigger with a k/v of
setthread/floordoor_mover

Then the floordoor mover itself is a bit funky.

Try this:
floordoor_mover:

self nottriggerable
$floordoor playsound door_wood_open_move1
$floordoor time 2
$floordoor rotateXup -90
$floordoor waitmove
$floordoor playsound door_wood_open_stop

wait 20 //since you want your door to stay open for 20 seconds

$floordoor playsound door_wood_close_move1
$floordoor time 2
$floordoor rotateXdown -90
$floordoor waitmove
$floordoor playsound door_wood_close_stop1

wait .1
self triggerable
end


You don't need the floordoor_speaker, as you can have the door itself play the sound.
Image
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Post by Shifty »

Cheers Very Much it worked great
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

self

Post by tltrude »

Hmmm, how does the thread know what "self" is? I don't think the trigger's targetname is automattically sent the the thread with "setthread". It would probably work just the same with those two lines remove--now that it has "waitmove".

One way to test it would be to add these lines to the bottom of the thread.

local.name = self // or is it "self"?
iprintln "self = " (local.name)


or maybe just

iprintln self

You could also test if the trigger is triggerable by increacing the "wait .1" at the bottom. If the door opens again right after it closes (while standing in the trigger or hitting use), then the nottriggerable was never set. If that is the case, you could fix it by replacing "self" with "$floordoor_trigger" in the thread.

As you can probably tell, I hate using "self" in threads that are triggered by only one trigger. What kind of trigger is it?
Tom Trude,

Image
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Post by Shifty »

Its a trigger_use I have to switches one above the hatch and one below.

I got it workin fine in the test map i made but now that i've added it the actual map for some reason the ability to plant the bombs has dissapeared :(

And as its allmost 1:00 am here and i've been staring at this for a while now a fresh pare eyes may spot the problem

Code: Select all

// Mammut Radar - Objective Version
// ARCHITECTURE: Shifty (Ian Allen)
// SCRIPTING: Shifty

main:

	setcvar "g_obj_alliedtext1" "Destroy The Radar" 
	setcvar "g_obj_alliedtext2" "Destroy The Power"
	setcvar "g_obj_alliedtext3" "Room"
	setcvar "g_obj_axistext1" "Defend the Radar"
	setcvar "g_obj_axistext2" "Defend The Power"
	setcvar "g_obj_axistext3" "Room"
	setcvar "g_scoreboardpic" "none"
	
	level waitTill prespawn
	
	exec global/DMprecache.scr

	exec global/door_locked.scr::lock
	level.script = obj_mammutradar.scr
	exec global/ambient.scr mohdm7
	thread global/exploder.scr::main

	level waittill spawn

floordoor_mover: 

self nottriggerable 
$floordoor playsound door_wood_open_move1 
$floordoor time 2 
$floordoor rotateXup -90 
$floordoor waitmove 
$floordoor playsound door_wood_open_stop 

wait 20 //since you want your door to stay open for 20 seconds 

$floordoor playsound door_wood_close_move1 
$floordoor time 2 
$floordoor rotateXdown -90 
$floordoor waitmove 
$floordoor playsound door_wood_close_stop1 

wait .1 
self triggerable 
end 

level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 2
level.bomb_damage = 200


// Set the parameters for round based match
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw


// level waittill roundstart // Comment out this line using '//' before it to be able to set the bomb when alone on the map ( just for testing )


$panel_bomb thread global/obj_dm.scr::bomb_thinker
$pr_bomb thread global/obj_dm.scr::bomb_thinker
thread allies_win_bomb
$panel_bomb thread axis_win_timer
$pr_bomb thread axis_win_timer
end // end of main

// Allied victory test


allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy) 
waitframe
teamwin allies
end

// Axis victory test


axis_win_timer:
level waittill axiswin
end
Also I have another request for some reason i've managed to delete the read me i wrote and my memory is so bad I dont wanna miss thanking some one for there help - so if you've downloaded one of the pre - betas can you send me the readme please

All thats left to do now is get the script right and clean up some minor things that I've noticed and I'll be releasing the Official Beta

Thanks very much

Shifty
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

move the thread floordoor_mover out of the main thread (below it's 'end')
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Code: Select all

// Mammut Radar - Objective Version
// ARCHITECTURE: Shifty (Ian Allen)
// SCRIPTING: Shifty
main:
setcvar "g_obj_alliedtext1" "Destroy The Radar" 
setcvar "g_obj_alliedtext2" "Destroy The Power"
setcvar "g_obj_alliedtext3" "Room"
setcvar "g_obj_axistext1" "Defend the Radar"
setcvar "g_obj_axistext2" "Defend The Power"
setcvar "g_obj_axistext3" "Room"
setcvar "g_scoreboardpic" "none"
level waitTill prespawn
exec global/DMprecache.scr
exec global/door_locked.scr::lock
level.script = obj_mammutradar.scr
exec global/ambient.scr mohdm7
thread global/exploder.scr::main
level waittill spawn
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 2
level.bomb_damage = 200
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw
// level waittill roundstart 
$panel_bomb thread global/obj_dm.scr::bomb_thinker
$pr_bomb thread global/obj_dm.scr::bomb_thinker
thread allies_win_bomb
$panel_bomb thread axis_win_timer
$pr_bomb thread axis_win_timer
end

allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy) 
waitframe
teamwin allies
end

axis_win_timer:
level waittill axiswin
end

floordoor_mover: 
self nottriggerable 
$floordoor playsound door_wood_open_move1 
$floordoor time 2 
$floordoor rotateXup -90 
$floordoor waitmove 
$floordoor playsound door_wood_open_stop 
wait 20 //since you want your door to stay open for 20 seconds 
$floordoor playsound door_wood_close_move1 
$floordoor time 2 
$floordoor rotateXdown -90 
$floordoor waitmove 
$floordoor playsound door_wood_close_stop1 
wait .1 
self triggerable 
end
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post by Axion »

I mailed you the read me file.
"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Re: self

Post by crunch »

tltrude wrote:Hmmm, how does the thread know what "self" is?
Since that trigger called the thread, that trigger is its owner, therefore it follows that "self" is in fact the trigger. At least that is my understanding. :)
Image
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Post by Shifty »

Well I placed it in the map but had to rotate it 90 degress and now instead of it opening on its origin (where x is the origin) :-

Should be rotaing up 90 degress up and to the left

X----------------------

Its rotating on the centre of the door and now it rotates towards you??


X----------------------X


But I have the origin brush in the correct place would I have to alter the script to suit this?
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Have u rotated the door+origin in the new map? If so, try rotateYup (or was it rotateZup?)
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Post by Shifty »

Yeah that makes sense wacko m8 I'll try that when i get home from work only got 4 hours to go :(
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

hatch

Post by tltrude »

Make sure that the origin brush and the hatch are one object. It will probably be The Z axis, if X does not work.
Last edited by tltrude on Mon Feb 23, 2004 10:08 pm, edited 1 time in total.
Tom Trude,

Image
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Post by Shifty »

Yup wacko that solved it cheers
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
Post Reply