SCRIPTING i need help need ppls mercy :banghead:


(smallwood2000) #1

I cant do the scripting side i just get a fat headache and do not understand a thing about it,i have tried to download tutorials and also all the links in here sum dont work, ive still got the problem of the scripting side i just cant understand,

all i need is script for simple objectives that i could build my level around

i have ust built 1 level and put 2 scripts togher to work it from to seperates tutorials.

I have a room and a simple constructable objective all set out right, but the scripting is wrong like it has been on all my pervious maps.

the script is as follows if you can see any problems could you please help.
:banghead:

game_manager
{
spawn
{
wm_axis_respawntime 16
wm_allied_respawntime 16
wm_set_round_timelimit 20
}
fence
{
spawn
{
}
built final
{
}
decayed final
{
}
death
{
}
}
spawn
{
wait 200
constructible_class 2
constructible_constructxpbonus 1
constructible_destructxpbonus 1
setstate fence_materials invisible
}
built final
{
setstate fence default
setstate fence_materials invisible
}
decayed final
{
setstate fence_materials default
setstate fence invisible
}
death
{
wm_announce “The fence has been destroyed!”
setstate fence_materials default
}
}

also my entitles make out that the scriptname is fence

im sure that all other entitles are correct is anything up with my script


(TFate) #2

Hmm, no offense but that script is a mess. It’s ok, eventually you’ll get the hang of it. It takes a while to get comfortable with ET’s scripting language but you should find out that it’s quite simple. You’re missing brackets and lines everywhere.

In your script here’s what the game WOULD BE seeing if you had included an extra “}” after the spawntimes and timelimit controls.

fence
{
	spawn
	{
	}

	built final
	{
	}
	
	decayed final
	{
	}

	death
	{
	}
}

Basically you’ve told the fence to spawn but you haven’t given it any attributes. Everything you have after that is ignored as it’s not being applied to fence.

Try this instead. Remember the amount of “{” should equal the amount of “}”.

game_manager
{
	spawn
	{
		wait 150				//Let the game rest for a sec.

		wm_axis_respawntime 16
		wm_allied_respawntime 16
		wm_set_round_timelimit 20
	}
}

fence
{
	spawn
	{
		wait 200
		constructible_class 2		//Satchel-able objective.
		constructible_constructxpbonus 1
	}

	built final
	{
		setstate fence default
		setstate fence_materials invisible
	}
	
	decayed final
	{
		setstate fence invisible
		setstate fence_materials default
	}

	buildstart final	//I'm not sure if this is necessary.
	{
		setstate fence underconstruction	//Include it anyway.
		setstate fence_materials default
	}

	death
	{
		setstate fence_materials default
		wm_announce "The Fence has been destroyed!"
	}
}

Notice that this version is much “cleaner” and should help you better understand how everything is working.

Edit: fixed something in the script.


(smallwood2000) #3

So if it looks like i really need to learn my script, tihs is so confusing even though i have tried several tutorials

Thank you very much for ur time and were did u learn how to script.


(smallwood2000) #4

ok just tried out my script/level and got an error message regarding did not understand fence line 8

line 8 goes
wm_allied_respawntime 16
wm_set_round_timelimit 20
}
}

fence

it could be relating to line 13 witch is fence


(smallwood2000) #5

my entitles just in case its needed are

for the finished constructing just a triangler brush on my map

classname func_consructable
spawnflags 5
scriptname fence
targetname fence

for the trigger sourounding the brush

classname trigger_objective_info
target fence
targetname fence_toi
track you smell
spawnflags 1

the constrution matirals just a normal brush textured like d construction itself

targetname fence_materials
target fence_toi
classname func_brushmodel

also just for the side it one of my fist map above the consruction is a wolf_objective for me to send up on the comand map with the following entitles

default_axis= ticked

spawnflags 1
description bomb dis
target fence
classname team_WOLF_objective
origin 256 64 152

i have done the mapcoords on the biggest brush aswell

on the constrution brush aswell i wos told tick tick prebuilt and axis_constrtutable so i have

can u see were ive gone wrong cheers for the help


(TFate) #6

I learned to script the old-fashioned way… by studying stock ET scripts and by creating my own little test maps.

The trigger_objective_info should have “axis_objective” and “is_objective” checked (or “allied_objective” if the Axis blow it up).

The func_brushmodel SHOULD NOT target the fence.

Get RID of the team_wolf_objective. TWO’s are used for spawnpoints, not objectives, due to its slightly different usage in RtCW.


(smallwood2000) #7

i have done all that but still when trying to play my map an error message appears

this message reads

G_scriptphase(),error(line 8):Unknown event : fence


(smallwood2000) #8

The smile did not mean to pop up


(Ifurita) #9

if you didn’t fix your { and } the way TFate suggested, then the game still thinks ‘fence’ is a script block WITHIN game_manager and doesn’t understand the command ‘fence’


(smallwood2000) #10

huh i copyed tfates script and used that

sos im a newbie


(Ifurita) #11

well, can you post the script then? Did the script get saved as [mapname].script or [mapname].script.txt? It sounds like it’s still reading your old script. Try look at your files with known extensions on


(smallwood2000) #12

THANK U

im now running arownd and bolow up my object a huge jump 4 me um im now wondering why dont my construction matirals witch is just a textured square brush show up i followed what tfate wrote just wondered why the materials dont show up

cheers again for the help


(smallwood2000) #13

but i can still construct my building and blow it up

and it shows up on th limbo map


(smallwood2000) #14

game_manager
{
spawn
{
wait 150 //Let the game rest for a sec.

  wm_axis_respawntime 16
  wm_allied_respawntime 16
  wm_set_round_timelimit 20

}
}

fence
{
spawn
{
wait 200
constructible_class 2 //Satchel-able objective.
constructible_constructxpbonus 1
}

built final
{
setstate fence default
setstate fence_materials invisible
}

decayed final
{
setstate fence invisible
setstate fence_materials default
}

buildstart final //I’m not sure if this is necessary.
{
setstate fence underconstruction //Include it anyway.
setstate fence_materials default
}

death
{
setstate fence_materials default
wm_announce “The Fence has been destroyed!”
}
}

consturction materials entitles

targetname fence_materials
classname fenc_brushmodel


(Ifurita) #15

Shouldn’t that be a func_brushmodel?


(smallwood2000) #16

sos i did not read the classname is func_brushmodel i should of read my post i just cant get the materials to show in game


(TFate) #17

I use script_movers for my materials. Seems to work for me.


(Ifurita) #18

I use script_movers too


(smallwood2000) #19

huh instead of fun_brushmodel but do i give it a scriptname or anything and is this the same thing


(smallwood2000) #20

Confused on script mover wot boxes do i tick on the entitles