Problems with my map.


(mhunsche) #1

Hi

I hope someone can help me. I made a map using gtk Radiant, but when I try to test it, some features don’t work.
I think there is something wrong with my script.
It’s in the attachment. (The forum can’t handle .script, so i putted it on as a .txt)
On request I can add my .bsp or .map file, if that makes it easier.
These are the problems I experience:

  • On the second axis fence (axisconstruct_2):
    The crates don’t disappear when the construction is finished.
  • The axis_controls (which the allies have to destroy to win (eventually, I haven’t programmed that yet)). Should be destructible by dynamite only (as specified in the constructible_class 3). but when I try to test it, it is destroyable with any weapon.
  • There is a } at the end of the script, that shouldn’t be there. But if I remove it and try to test it, ET says that he misses a } (expected ‘}’ but received script end).

I asked a lot of my friends, but they couldn’t tell me what the problem is. That’s why I’m posting here now.
As I said, I hope someone can help me.
It’s not a big map so it won’t take much time finding the script components.

Thanks on forehand
Mhunsche


(Jecoliah) #2

Edit: Gave wrong answer so edited it out, sorry.

You should probably post the map file for the other problems.

Jec


(aaa4) #3

there are some code tags here in this forum:

axisconstruct_2//second axis fence
{
spawn
{
wait 500
trigger self setup
constructible_class 3 // 2=Satchel 3=Dyna
}

trigger setup
{
setstate axisconstruct_2_materials default // Crate Models
setstate axisconstruct_2_clip default // Clip brushes
setstate axisconstruct_2_flag default
}

built final
{
setstate axisconstruct_2_materials invisible // Crate Models
setstate axisconstruct_2_clip invisible // Clip brushes
setstate axisconstruct_2_flag invisible

wm_announce "Axis have built the second fence!"
}

decayed final
{
trigger self setup
}

death
{
trigger self setup
wm_announce "Allies have destroyed the second fence!"
}
}

and why dont you grab yourself some treatises about scripting. there are sure some available on the net. just use search, google, whatever.

generally spoken: if you want an entity to dissapear you just give it a targetname and do a “setstate targetname invisble” from script. not as hard, is it ?


(mhunsche) #4

I added the .map file.

The ‘trigger self setup’ is supposed to be there. My other constructibles have the same script and they work fine.

I got the prefab and the script template from a tutorial site (www.pythononline.co.uk). I asked the person who created the site and he told me he couldn’t find the problem either.

That’s what I did, right?

built final
	{
		setstate axisconstruct_2_materials invisible	// Crate Models
		setstate axisconstruct_2_clip invisible		// Clip brushes
		setstate axisconstruct_2_flag invisible
        }


(aaa4) #5

i know what could be wrong but it has been said a thousand times already.


(Jecoliah) #6

Ok, this was weird. There must have been some kind of non-displayed character in your script causing the problem. What i did is delete the axisconstruct_2 code and copied the axisconstruct_1 code and edited it to be the axisconstruct_2 code and it worked, and this also solved the extra “}” at the end.

So copy the below code and replace all the code in your script with this code and save it as your tpb.script.

game_manager
{
	spawn
	{
		wm_axis_respawntime	10
		wm_allied_respawntime	10
		wm_set_round_timelimit	30

		// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team	0

		// Winner on expiration of round timer (0=Axis, 1=Allies, -1=Nobody)
		wm_setwinner -1

		wait 500

		setautospawn "Axis Spawn" 0
		setautospawn "Allied Spawn" 1
	}
}

// ================================================
alliedconstruct_1 // the first allied fence
{
	spawn
	{
		wait 50
		trigger self setup
		constructible_class	2	// 2=Satchel 3=Dyna
	}

	trigger setup
	{
		setstate alliedconstruct_1_materials default	// Crate Models
		setstate alliedconstruct_1_clip default		// Clip brushes
		setstate alliedconstruct_1_flag default
	}

	built final
	{
		setstate alliedconstruct_1_materials invisible	// Crate Models
		setstate alliedconstruct_1_clip invisible	// Clip brushes
		setstate alliedconstruct_1_flag invisible

		wm_announce "Allied Team have built the first fence!"
	}

	decayed final
	{
		trigger self setup
	}

	death
	{
		trigger self setup
		wm_announce "Axis have destroyed the first fence!" 
	}
}



// ================================================
alliedconstruct_2 // allied second fence
{
	spawn
	{
		wait 50
		trigger self setup
		constructible_class	3	// 2=Satchel 3=Dyna
	}

	trigger setup
	{
		setstate alliedconstruct_2_materials default	// Crate Models
		setstate alliedconstruct_2_clip default		// Clip brushes
		setstate alliedconstruct_2_flag default
	}

	built final
	{
		setstate alliedconstruct_2_materials invisible	// Crate Models
		setstate alliedconstruct_2_clip invisible	// Clip brushes
		setstate alliedconstruct_2_flag invisible

		wm_announce "Allied Team have built the second fence!"
	}

	decayed final
	{
		trigger self setup
	}

	death
	{
		trigger self setup
		wm_announce "Axis have destroyed the second fence!" 
	}
}

// ================================================
axisconstruct_1 // axis first fence
{
	spawn
	{
		wait 50
		trigger self setup
		constructible_class	2	// 2=Satchel 3=Dyna
	}

	trigger setup
	{
		setstate axisconstruct_1_materials default	// Crate Models
		setstate axisconstruct_1_clip default		// Clip brushes
		setstate axisconstruct_1_flag default
	}

	built final
	{
		setstate axisconstruct_1_materials invisible	// Crate Models
		setstate axisconstruct_1_clip invisible		// Clip brushes
		setstate axisconstruct_1_flag invisible

		wm_announce "Axis have built the first fence!"
	}

	decayed final
	{
		trigger self setup
	}

	death
	{
		trigger self setup
		wm_announce "Allies have destroyed the first fence!" 
	}
}

// ================================================
axisconstruct_2 // axis first fence
{
	spawn
	{
		wait 50
		trigger self setup
		constructible_class	3	// 2=Satchel 3=Dyna
	}

	trigger setup
	{
		setstate axisconstruct_2_materials default	// Crate Models
		setstate axisconstruct_2_clip default		// Clip brushes
		setstate axisconstruct_2_flag default
	}

	built final
	{
		setstate axisconstruct_2_materials invisible	// Crate Models
		setstate axisconstruct_2_clip invisible		// Clip brushes
		setstate axisconstruct_2_flag invisible

		wm_announce "Axis have built the second fence!"
	}

	decayed final
	{
		trigger self setup
	}

	death
	{
		trigger self setup
		wm_announce "Allies have destroyed the second fence!" 
	}
}
//==================================================

// =================================================
Axis_Controls // the allied obj
{
	spawn
	{
		wait 300
		constructible_class 3 // 2=satchel  3=dyna
	}

	death
	{
		trigger Axis_Controls_toi remove

		wm_announce "The Allies have destroyed the Axis Controls!"
	}
}

Axis_Controls_toi
{
	trigger remove
	{
		remove
	}
}


//=============================================================
// Targets
alliesbarier1 
{
    death
    {
    wm_announce "^1The Allies have destroyed the firt barrier!"
    }
}

 alliesbarier2
{
    death 
    {
    wm_announce "^1The Allies have destroyed the second barrier!"
    }
}

alliesbarier3
{
    death 
    {
    wm_announce "^1The Allies have destroyed the third barrier!"
    }
}

alliesbarier4
{
    death 
    {
    wm_announce "^1The Allies have destroyed the fourth barrier!"
    }
}

axisbarier1
{
    death
    {
    wm_announce "^1The Axis have destroyed the fist barrier!"
    }
}

axisbarier2
{
    death
    {
    wm_announce "^1The Axis have destroyed the second barrier!"
    }
}

axisbarier3
{
    death
    {
    wm_announce "^1The Axis have destroyed the third barrier!"
    }
}

axisbarier4
{
    death
    {
    wm_announce "^1The Axis have destroyed the fourth barrier!"
    }
}
  • The axis_controls (which the allies have to destroy to win (eventually, I haven’t programmed that yet)). Should be destructible by dynamite only (as specified in the constructible_class 3). but when I try to test it, it is destroyable with any weapon.

I am now looking into this ^

Edit: You need to add the key (Health 0) to the entity.

So…

Key: Health
Value: 0

Jec


(mhunsche) #7

Thank you so much!!

The script as you posted it works perfectly. The obj is dyna-only too! So the problems are now sloved.

I feel stupid for not trying to copy it all…

Thanks again!


(Jecoliah) #8

[QUOTE=mhunsche;219575]Thank you so much!!

The script as you posted it works perfectly. The obj is dyna-only too! So the problems are now sloved.

I feel stupid for not trying to copy it all…

Thanks again![/QUOTE]

Glad i could help.

Jec