would someoen plz teach me how to script for my level


(Ifurita) #41

follow the brackets. A section of script typically looks like this:


//Main Gate
maingate_script
{
	spawn 
	{
		wait 200
		constructible_class 3
	}

	death 
	{
		setstate sally_port	invisible //Kills side team door when main gate is blown

		wm_announce "Axis have breached the Main Gate"

		wm_objective_status 1 0 1
		wm_objective_status 1 1 2
	}
}

The first line, or anything that follows // is a comment
Entire sections or subsections of script are started by { and ended by }
maingate_script is the scriptname, which is called by the func_constructible entity
spawn and death are subroutines of maingate_script that tell the game what to do with the maingate at gamestart (spawn) and when it’s blown up (death)

Then again, this was all explained in scripting for newbies too.


(Lock Ness Monster) #42

lol, ok, i think i got some of that. ok so spawn means the beginning of the game and death means the end when the object is blown up, right? so what does the wait 200 mean, and does the construcible_class 3 mean, it can only be blown up by dynamite?

and i think i got most of the death part, i dont get that sally port part, but im guessing that the invisble thing means that the door is suppose to disappear after teh dynamite explodes acting like its been destroyed, and i understand about the announcing part, but what does that last part mean in the objective status thing?


(Ifurita) #43

you typically need waits after the spawn, think of it as a pause to give the server time to get everything sorted out

constructible class 3 = requires 1.5 charge bar to build, only destroyable by dynamite (see the LDR for a description of constructible classes) - you’ve read that, right?

Level Designers Reference/construction.html#conclasses

you are correct about the setstate sally_port invisible. When the maindoor is blown (death), the entity defined as ‘sally_port’ (e.g., the side door) disappears

The wm_objective_status is also explained in the “scripting for Newbies”, the LDR

wm_objective_status <objective_number> <team> <status(0:blank|1:tick|2:cross)>
Sets the tick or cross status overlay on the objective panel in the limbo menu for the specific objective.

and here: http://planetwolfenstein.com/4newbies/limbo.htm


(Lock Ness Monster) #44

where is it, ive tried looking it up in ur site about scripting, but i only find the scripting that deals with the keys


(Ifurita) #45

http://planetwolfenstein.com/4newbies/Map_Scripting_4_Newbies.pdf

pg 3 - basic components
pg 4 - anatomy of a script
pg 7 - wm_objective_status explanation
pg 8 - graphic of the limbo/objective screen showing where each data element comes from

I posted this link earlier and you said you still didn’t understand it, but it doesn’t seem like you ever looked at it


(Lock Ness Monster) #46

i did, but i didnt see the part about map scripting, i saw the other type, i think thats y i got so confused lol


(Ifurita) #47

It’s only 22 pages about map scripting with a single reference to config scripting which was only used as an analogy.


(Lock Ness Monster) #48

ok, i tried downloading that thing, but when i bring it up, it wants to come up in photoshop and its covered with sqaures and its hard to read, can i some how cahnge it to open up in a word document instead?


(Ifurita) #49

It’s a PDF document. Do you have adobe reader installed?


(Lock Ness Monster) #50

i dont think so, i dont even know if i got adobe reader


(Ifurita) #51

sigh … http://www.adobe.com/products/acrobat/readstep2.html


(Lock Ness Monster) #52

be patient lol, there is tons of things i dont understand yet lol

and i know u will probably say no, but could u im me or let me im u, and just led me trough some scripts, i do undersstand some of this, but i understand it more when someone is like actually leading me through it and not on a forum, u dont have to be it would make it alot easier and i wouldnt be as much of a bother


(Ifurita) #53

no, I will not do this via IM. If I do, I’m setting myself up to be at your beck and call whenever you have a question. I absolutely refuse.


(Lock Ness Monster) #54

ok, sorry

would anyone be willing to teach me over im, it would really make all this easier, plz someone


(Lock Ness Monster) #55

ok Ifurita, i think u might be happy, after looking at a sample and using the Fuel Dump script as a reference, i made my own script. tried to anyway lol, this is what i got.

game_manager
{
spawn
{
// Game rules
wm_axis_respawntime 30
wm_allied_respawntime 20
wm_number_of_objectives 1
wm_set_round_timelimit 30

//-----------------------------------
// Destroying The COmputer
//-----------------------------------
trigger objective1

The_Computer
{
spawn
{
wait 200

	constructible_class 3


	setstate thecomputer_solid defualt
	
}

death

{
	trigger game_manger objective1
}

}

and on my objective i got

mass 650
scriptname computer
targetname dynawall
type metal
noise C:/Program Files/Wolfenstein - Enemy Territory/etmain/sound/world/metalbreak.wav
health 0
spawnflags 4
classname func_sxplosive

and on the trigger box around it

track The Computer
objflags 4
spawnflags 1
classname trigger_objective_info
target dynawall
scriptname The_Computer
targetname The_Computer
shortname The Computer

and i do have it fixed in the thing with tabs and all

i knwo that isnt right cause when i tried to run the level an error about my script came up, and since im a complete newbie at this stuff, i dont know what to do to fix it, i just want to make a simple script see if i can get things to blow up, can u tell me what im doing wrong?

If anyone else gets here before Ifurita and knows the answer, go ahead and let me know lol


(SCDS_reyalP) #56

If you are going to post script, use


code tags


If you are going to ask about an error message, post the exact message. We are mostly not psychic. Use alt+enter to switch et to windowed mode, and then type the exact error message in your post.

Offhand, I notice one problem in what you posted

noise C:/Program Files/Wolfenstein - Enemy Territory/etmain/sound/world/metalbreak.wav

This needs to be a relative path, like sound/world/metalbreak.wav


(Ifurita) #57
  1. You’re missing two }, one to end game_manager/spawn and another to end game_manager
  2. You spelled default wrong
  3. You spelled func_explosive wrong

(Lock Ness Monster) #58

forget the error message, it lets me in now, thanks Ifurita, im just wondering now, what do i have to put in my script to make the object look like its blown up and how to make it that when u do blow it up teh allies when

cause when i plant dynamite it says dynamite planted, but the object doesnt blow up when the dynamite does


(nUllSkillZ) #59

There have to be equal numbers of openeing “{” and closing “}”.
I haven’t looked at your scriped but I guess you have more “{” then “}”.
You should format your script.
I’m using tabs.
It’s much easier then to find these mistakes.

We’ve tried to tell you that a script contains several script blocks.
For each entity (and the game manager) one script block.
All these script blocks start with the scriptname of the entity (or game_manager).
They start with “{” and end with “}”.

Within the entity script blocks there are event script blocks.
Starting with the eventname.
They start with “{” and end with “}”.
Within these event script blocks there are the actions that will take place if an event is triggered.

With this information you get this:


game_manager
{
	EVENTNAME
	{
		ACTION
		// ...
	}
	// ...
}

ENTITYSCRIPTNAME_I
{
	EVENTNAME
	{
		ACTION
		// ...
	}
	// ...
}

// ...


(Ifurita) #60

Here’s the tutorial I used to make the debris

http://www.wolfensteinx.com/surface/tutorials/damage.html