would someoen plz teach me how to script for my level


(Lock Ness Monster) #81

ok forget that i can get in now, but when i got in, the swtichs for the elevator r gone, invisable or soemthing, how do i get them to show


(Lock Ness Monster) #82

lol, well i fixed that problem to,and i got a hand symbol to pop up at the button. but when i press enter button the elevator comes up.

maybe i haev somethings set wrong, uve seen my script and it was ok, so my only idea now is the key values of them. this is what i got on them

platform

classname script_mover
spawnflags 2
scriptname platform

func_invisible over bottem floor trigger
classname func_invisible_user
cursorhint hint_button
target button_01

target_script_trigger for bottem button
classname target_script_trigger
targetname button_01
scriptname move_platform
target move_to_destination

func_invisible over top button
classname func_invisible_user
target button_02
cursorhint hint_button

target trigger over top button
classname target_script_trigger
target move_to_start
targetname button_02
scriptname move_platform

i have 2 path_corners, one at the bottem of the elevator and one at the top, the one at the top as a targetname of point_00 and the one at the bottem has a targetname of point_01

i also have a orgin brush in the middle of the platform

so what all do i got to add or fix to make it move

just in case here is the script for that level

game_manager
{
}

platform
{
//goes up

trigger move_to_destination
{
wait 1000
gotomarker point_00\

}

//goes down
trigger move_to_start
{

 wait 1000 
 gotomarker point_01 
} 

}


(Lock Ness Monster) #83

people dont leave me hanging, plz someone figure this out for me, im getting a headache cause of it lol


(_Muzzle_) #84

I think i found your problem , look at the targets

the one at the top as a targetname of point_00 and the one at the bottem has a targetname of point_01

target button_02

maybe you want to change targets :smiley:


(Lock Ness Monster) #85

Ge willikers, that might be the problem, ill test it right away, if that is the problem i will feel so stupid lol


(Ifurita) #86

get used to it. Seems like most scripting problems are of the “stupid, I forgot something really basic” type


(_Muzzle_) #87

lol just found a typo myself, after a half hour looking at my script i found a typo in 1 of my keys :angry:


(Lock Ness Monster) #88

lift
{
spawn
{
accum 0 set 0 // Lift postion (0 = down, 1 = up)
accum 1 set 0 // is lidt moving?

	wait 200 // let things spawn

	trigger top_button_1 in
	trigger bottem_button_1 in

}

trigger move_up
{
accum 0 abort_if_not_equal 0
accum 1 abort_if_not_equal 0

accum 1 set 1

wait 400

gotomarker path_lift_top 50 wait

trigger top_button_1 out
trigger bottem_button_1 out

accum 1 set 0
accum 0 set 1

}

trigger move_down
{
accum 0 abort_if_not_equal 1
accum 1 abort_if_not_equal 0

accum 1 set 1

trigger top_button_1 in
trigger bottem_button_1 in

wait 400

gotomarker path_lift_bottem 50 wait

trigger top_button_1 out
trigger bottem_button_1 out

accum 1 set 0
accum 0 set 0

}

that is the script for it, buy when i run the level it says its expecting a } in like 51, but i got one, and i keep on getting errors like that i mentions earlier. what is wrong with my script


(Ifurita) #89

you need another } at the bottom to close the


lift 
{ 


  1. Indents are your friend
  2. Be more thorough in checking you work. Sometimes I find it helpful to print my script out and connect corresponding { and } with an ink pen to me see what’s closed and what isn’t

(Lock Ness Monster) #90

thats a great idea about printing, but i dont got no ink lol, and anyway i didnt know it had to be done like that


(Ifurita) #91

Here’s how I typically organize my .script files


// ============================================================================ 
// DESTRUCTIBLE OBJECTIVES ===================================================
// ============================================================================ 

//West Gate
west_gate
{
	spawn 
	{
		wait 200
		constructible_class 3
	}

	death 
	{
		wm_announce "Allies have breached the West Gate"

		wm_objective_status 1 0 2
		wm_objective_status 1 1 1

		// set forward spawn as allies and remove flag
		trigger forward_spawn allied_keep		
	}
}

//East Gate
east_gate
{
	spawn 
	{
		wait 200
		constructible_class 3
	}

	death 
	{
		wm_announce "Allies have breached the East Gate"

		wm_objective_status 2 0 2
		wm_objective_status 2 1 1
	}
}

//Water Cisterns
cistern_controls
{
	spawn 
	{
		wait 200
		constructible_class 3

		setstate cistern_controls_toi invisible
	}

	death 
	{
		wm_announce "Allies have destroyed the water cisterns"

		wm_objective_status 5 0 2
		wm_objective_status 5 1 1

		trigger game_manager alliedobjectivecounter // Inc counter game counter 
	}
}

With the indents, it’s easy to see what is grouped together in one section - like sentences in a paragraph and paragraphs in a chapter. Sure, you can run everything together, but you;re just making it harder on yourself and everyone else.

I use comments (//) to identify sections. In this case, all of my destructible objectives are in the same section


(_Muzzle_) #92

I also use titles like chapters of my great scriptbook :smiley:
and just count the indents if you just added something to your script, if you get an even number they’re al there and if you get and uneven number you are missing 1.


(Lock Ness Monster) #93

well i fixed the target error and i can also get in the map now, but still teh elevator doesnt not want to go up, is there a way where i can send yall my testmap and script for it so maybe one of u can spot its problem, i know it is somehting small, but i have no clue what it is?


(_Muzzle_) #94

just put your script code and map code up here if it’s not too big


(Lock Ness Monster) #95

ok

this is what i got now

---------the moving platfofm and its origin brush-----( that doesnt want to move lol)
scriptname platform
spawnflags 2
classname script_mover
targetname platform

-----------------trigger brush over the bottem button---------------------
target button_01
cursorhint hint_button
classname func_invisible_user

-----------------target_script_trigger for bottem button------------------ ( ur suppose to have one of these there right?)
target move_to_destination
scriptname move_platform
targetname button_01
classname target_script_trigger

---------trigger over top button---------
cursorhint hint_button
target button_00
classname func_invisible_user

-----------target_script_trigger for top button--------------( doint know if im suppose to have this or not)
scriptname move_platform
targetname button_00
target move_to_start
classname target_script_trigger

---------------path_corner marking the bottem of the elevator-------
targetname button_00
classname path_corner

---------------path_corner marking the top of the elevator-------
targetname button_01
classname_corner

(also i didnt know if i was suppose to have this or not but i put in a script_multiplayer, i dont know what properties to give it if im suppose to have it in there, it doesnt work also if i dont have it so yeah)

and my script for it

game_manager
{
}

                 platform 
                 { 
                                              //goes up 

                                                            trigger move_to_destination 
                                                            { 

                                                                              gotomarker button_01

                                                            } 

                                                //goes down 

                                                            trigger move_to_start 
                                                            { 

                                                                                wait 1000 

                                                                                 gotomarker button_00 
                                                            } 

}


(Lock Ness Monster) #96

ok, i dont get something, how to i keep the spaces in there, i have use spaces and tabs but they get deleted when i post them, i got them in spaces in my script but when i copy and paste, they get deleted


(nUllSkillZ) #97

Just use the [ code ] [ /code ] tag’s (without the spaces) to post your script.


(Lock Ness Monster) #98

what is a code tag?


(Vitriol) #99

when you make a post, type exactly what nullskillz posted (without the spaces as he pointed out), then post your script in between those 2 tags. it will put it in a nice quote type box.


(Lock Ness Monster) #100

ok, ive got some more help to ask for lol, on here i somewhere in the forums i found a link to a german video tutorial about scripting/mapping, even though i cant understand a damn word they say lol, well except for the key names and all, it has helped me greatly, in just 30 mins i learned how to make single stage constructable objects, and im almost done with make a CTF type objective just for test on it also, but i got a problem with it, i fully copied everything that i noticed in the tutorial and in the script. but when i run the level the vault, documents in it, and the table outside the u have to palce them in r all not there. But when i walk to where the table is, it says “The Table” like i have it fixed and when i go to where the documents r suppose to be, it says allies have taken the documents like its suppose to be, so its like i take soemthing, but nothing has a model for it. any ideas yall, and just to let yall know, dont know if it will help any, but i had the whole vault thing in another map, but something happened and the grown copied with the stuff and the ground became part of it also, so when i tried to run the level, it said the first entity is not worldspawn, so when i go back to try and change it, the ground doesnt want to change back to world spawn for me, so i dont know how to fix that also. So i took the vault, flag inside that is suppose to have the document model, teh table out side, the game_manger thingy, and the Wolf_objective thing and made them all a prefab so i could just put it in another map easily, and when i did, every object that was a in that prefab is not in my map or is invisible or something. Can anyone tell me how to fix this, also if u want me to type out all i got, it would be much easier on all of us if u just watch the 7:09 movie at http://www.level-designer.de/index.php?option=com_remository&Itemid=37&func=fileinfo&parent=category&filecatid=81