Script Problem Construction


(Glo) #1

Hey guys,

I made a simple script :

fence
{
spawn
{
wait 200
constructible_class 1
constructible_constructxpbonus 1
constructible_destructxpbonus 1
setstate fence_materials visible
}
built final
{
setstate fence default
setstate fence_materials invisible
}
decayed final
{
setstate fence_materials default
setstate fence invisible
}
{
wm_announce “The fence has been destroyed!”
setstate fence_materials visible
}
}

everything works, but when I construct it, the materials wont dissapear, … and I putted it to invisible, I checked everything but it wont go away !

Can anyone help?


(UJERebel) #2

fence_materials, what kind of entity is this?
any entity thats suppoerts setstate? i suppose a misc model?
Can you give any more info?:rolleyes:

Grtz


(Destroy666) #3

You forgot to put ‘death’ beforw last scriptblock.

death
{
wm_announce “The fence has been destroyed!”
setstate fence_materials visible
}


(Glo) #4

fence
{
spawn
{
wait 200
constructible_class 1
constructible_constructxpbonus 1
constructible_destructxpbonus 1
setstate fence_materials visible
}
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 visible
}
}

Thats the new code then?

Fence materials is:
classname: - script_mover
scriptname: objective_materials
target: fence_toi
targetname: fence_materials

Just tried it again, and the materials wont dissapear after I constructed it !


(Wezelkrozum) #5

you should really use the command default in stead of visible in your script.


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

In the death and the spawn block.


(Glo) #6

I did it, but the damm thing still wont work, really annoying …

fence
{
spawn
{
wait 200
constructible_class 1
constructible_constructxpbonus 1
constructible_destructxpbonus 1
setstate fence_materials default
}
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
}
}

Here is the map file, so someone can look into it, its really simple rooms, I am just trying everything out … http://www.2shared.com/file/12237112/6ba74afa/ROOM.html


(Jecoliah) #7

[QUOTE=Glo;219227]I did it, but the damm thing still wont work, really annoying …

Here is the map file, so someone can look into it, its really simple rooms, I am just trying everything out … http://www.2shared.com/file/12237112/6ba74afa/ROOM.html[/QUOTE]

//Fence Script

fence
{ 
	spawn 
	{ 
		wait 400 
		constructible_class 1
		constructible_constructxpbonus 1
		constructible_destructxpbonus 1 
		trigger self startup
	} 
	
	buildstart final 
	{ 
	} 

	built final 
	{ 
		setstate fence default 
		setstate fence_materials invisible
	} 

	decayed final 
	{ 
		trigger self startup 
	} 

	death 
	{
		trigger self startup 
		wm_announce "The fence has been destroyed!"
	} 

	trigger startup 
	{ 
		setstate fence invisible
		setstate fence_materials default 
	} 
}

(Glo) #8

do I need to put something in so the scripts starts or something ? How do I actually know if the script is working?

Its still not working, mmh … maybe somethings wrong in my map ?
Where do I need to put the scripts ? in the etmain/maps as fence.script file right ?


(nUllSkillZ) #9

There has to be another entity in the map to make the script work.
Can’t remember the entity name :frowning:

Edit:

You should have a look at the map sources of the official maps.
There’s an option in GTKRadiant which shows the used entities in a map.
Also not sure in which menu or how the menu entry is named.


(stealth6) #10

script_multiplayer -> need to have one and one only of those.


(Jecoliah) #11

[QUOTE=Glo;219239]do I need to put something in so the scripts starts or something ? How do I actually know if the script is working?

Its still not working, mmh … maybe somethings wrong in my map ?
Where do I need to put the scripts ? in the etmain/maps as fence.script file right ?[/QUOTE]

Yes, Script goes in Maps folder but with the Name of Your Map “Room.script”

I tested my script with your map and it works.

Jec


(Glo) #12

[QUOTE=Jecoliah;219244]Yes, Script goes in Maps folder but with the Name of Your Map “Room.script”

I tested my script with your map and it works.

Jec[/QUOTE]

Cheers it worked, I renamed it to Room.script and it works, how come it didn’t work before?


(Jecoliah) #13

Don’t know why your script didn’t work because I didn’t troubleshoot your script I just plugged your entity names into my script and tested it.

Jec


(Glo) #14

[QUOTE=Jecoliah;219258]Don’t know why your script didn’t work because I didn’t troubleshoot your script I just plugged your entity names into my script and tested it.

Jec[/QUOTE]

I just changes the script name and it works ? Isn’t that weird?


(Jecoliah) #15

Well, the script Name HAS to be the same name as your map (of course with .script extension).

Jec


(Glo) #16

I got one more question for this topic, where can I find the construction box like the real one’s ingame ? with the flag ?


(masterkiller) #17

hi,

crate (allied for ex: )

“classname” “misc_gamemodel”
“model” “models/mapobjects/cmarker/cmarker_crates.md3”
“skin” “models/mapobjects/cmarker/allied_crates.skin”
“targetname” “alliedconstruct1_crates”

flag (allies)

“classname” “misc_gamemodel”
“model” “models/mapobjects/cmarker/cmarker_flag.md3”
“skin” “models/mapobjects/cmarker/allied_cflag.skin”
“targetname” “alliedconstruct1_flag”
“frames” “190”
“spawnflags” “2”
“modelscale” “0.4”

Clip brush to clip the crate:
“classname” “script_mover”
“targetname” “alliedconstruct1_clip”
“scriptname” “alliedconstruct1_clip”

Then us
setstate alliedconstruct1_crates (default/invisible)
setstate alliedconstruct1_clip (default/invisible)
and
setstate alliedconstruct1_flag (default/invisible)
in your script

I merely pass / leave after a search on this great website :slight_smile:
gl


(Jecoliah) #18

Check out this Tutorial and the other Tutorials as well. It will help you alot.

http://www.pythononline.co.uk/et/tutorial15.htm

Jec