script crash!!help!!


(twt_thunder) #1

hey try to do some scripting with objectives

but you may see on the picture what i get as error

and here’s the script:
(totally wrong i guess)



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 0

		wait 500

		//setautospawn "Axis Spawn" 0
		//setautospawn "Allied Spawn" 1
//------------------------------------------------------------------------
// objectives
//------------------------------------------------------------------------

//we have 2 objectives, taking the nuke and bringing them to the chopper:
vm_number_of_objectives 2 //we got 2 objectives

wm_set_objective_status 1 0 //setting obj 1 to axis status
wm_set_objective_status 2 0 //setting obj2 to axis status 0=axis 1=allied

wm_objective_axis_desc 1 "primary objective:**defend the depot door!!" //tell the axis to protect the door

wm_objective_axis_desc 2 "primary objective:**defend the nuke and return at all costs!!"

wm_objective_allied_desc 1 "blow the door to the depot"
wm_objective_allied_desc 2 "steal back the ^1NUKE ^7 and bring it to the chopper"

//wm_objective_image 1 "gfx/2d/objectives/door.tga"
//wm_objective_image 2 "gfx/2d/objectives/nuke.tga"
// these are the objectives picture that shows in the game menu

//wm_overwiev_image "video/something.roq" //a video?

//short descriptions

wm objective_short_axis_desc 1 "defend door"
wm_objective_short_axis_desc 2 "defend nuke"

wm_objective_short_allied_desc 1 "blow door"
wm_objective_short_allied_desc 2 "get nuke!"

// accum 1 for obj1 and accum2 for nmbr 2

accum 1 set 0
accum 2 set 0


	}
}

// axis door in front of objective

garagedoor
{
    spawn
    {
       wait 200
       constructible_class 3
    }

    death
    {
      wm_announce "^1us troops has blown the door"
      setstate garagedoor invisble
     
    }
}
//--------------------------------------------------------------------------
// THE OBJECTIVE AND RETURN

trigger nuke
{
wm_set_objective_status 2 1 
accum 2 set 1
wm_announce "Allied team has returned the nuke to safety!"
trigger game_manager checkgame
}

trigger axis_object_stolen
{
wm_set_objective_status 1 1
}

trigger axis_object_returned
{
wm_set_objective_status 1 0
}


trigger checkgame
{ 
accum 2 abort_if_not_equal 1
wm_setwinner 1
wait 1500
wm_endround
}
}


return
{
spawn
{
}
death
{
trigger game_manager objective1
}
}




  
//
//
//
//---------------------cps--------------------------------------------------
//

allied_cp_open
{
	spawn
	{
		wait 100
		accum 0 set 0			// 0=CP Closed, 1=CP Damaged
		constructible_class 2			// Dyno+Satchel

		trigger self disable_cp_features		// Default charge bar times
		setstate allied_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate allied_cp_damaged_model invisible

		wait 1000

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"
		// *----------------------------------- vo ------------------------------------------*
	}

	trigger disable_cp_features
	{
		setstate allied_cp_open_model invisible	// Hide Open CP model

		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1

		sethqstatus 1 0			// Landmines team warning message
		disablespeaker speaker_allied_cp		// Disable morse code sound
	}

	trigger enable_cp_features
	{
		setstate allied_cp_open_model default	// Show open CP model

		setchargetimefactor 1 soldier 0.75
		setchargetimefactor 1 lieutenant 0.75
		setchargetimefactor 1 medic 0.75
		setchargetimefactor 1 engineer 0.75
		setchargetimefactor 1 covertops 0.75

		sethqstatus 1 1			// Landmines team warning message
		enablespeaker speaker_allied_cp		// Enable morse code sound
	}

	buildstart final
	{
		setstate allied_cp_closed invisible		// Hide closed CP clipbrush+model
		setstate allied_cp_closed_model invisible
		setstate allied_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate allied_cp_damaged_model invisible
	}

	built final
	{
		accum 0 set 1			// Only show the damaged CP model
		trigger self enable_cp_features		// Increase charge bar times

		wm_announce "Allied Command Post constructed. Charge speed increased!"
		// *----------------------------------- vo ------------------------------------------*
		wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
		wm_teamvoiceannounce 1 "allies_hq_compost_constructed"

		wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		wm_addteamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		// *----------------------------------- vo ------------------------------------------*
	}

	decayed final
	{
		setstate allied_cp_open_model invisible	// Hide Open CP model
		trigger self show_damaged_cabinet	// Show previous cabinet state
		trigger self show_closed_cabinet
	}

	death
	{
		trigger self show_damaged_cabinet	// Show damaged CP model
		trigger self disable_cp_features		// Default charge bar times

		wm_announce "Axis team has destroyed the Allied Command Post!"
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_removeteamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		// *----------------------------------- vo ------------------------------------------*
	}

	trigger show_closed_cabinet
	{
		accum 0 abort_if_equal 1		// Closed cabinet active yet?
		setstate allied_cp_closed default
		setstate allied_cp_closed_model default
	}

	trigger show_damaged_cabinet
	{
		accum 0 abort_if_equal 0		// Damaged cabinet active yet?
		setstate allied_cp_damaged default
		setstate allied_cp_damaged_model default
	}
}


//-------------------------------------------------------------------------

axis_cp_open
{
	spawn
	{
		wait 100
		accum 0 set 0			// 0=CP Closed, 1=CP Damaged
		constructible_class 2			// Dyno+Satchel

		trigger self disable_cp_features		// Default charge bar times
		setstate axis_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate axis_cp_damaged_model invisible

		wait 1000
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_construct"
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"
		// *----------------------------------- vo ------------------------------------------*
	}

	trigger disable_cp_features
	{
		setstate axis_cp_open_model invisible	// Hide Open CP model

		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1

		sethqstatus 0 0			// Landmines team warning message
		disablespeaker speaker_axis_cp		// Disable morse code sound
	}

	trigger enable_cp_features
	{
		setstate axis_cp_open_model default	// Show open CP model

		setchargetimefactor 0 soldier 0.75
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.75
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75

		sethqstatus 0 1			// Landmines team warning message
		enablespeaker speaker_axis_cp		// Enable morse code sound
	}

	buildstart final
	{
		setstate axis_cp_closed invisible		// Hide closed CP clipbrush+model
		setstate axis_cp_closed_model invisible
		setstate axis_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate axis_cp_damaged_model invisible
	}

	built final
	{
		accum 0 set 1			// Only show the damaged CP model
		trigger self enable_cp_features		// Increase charge bar times

		wm_announce "Axis Command Post constructed. Charge speed increased!"
		// *----------------------------------- vo ------------------------------------------*
		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		wm_addteamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		// *----------------------------------- vo ------------------------------------------*
	}

	decayed final
	{
		setstate axis_cp_open_model invisible	// Hide Open CP model
		trigger self show_damaged_cabinet	// Show previous cabinet state
		trigger self show_closed_cabinet
	}

	death
	{
		trigger self show_damaged_cabinet	// Show damaged CP model
		trigger self disable_cp_features		// Default charge bar times

		wm_announce "Allied team has destroyed the Axis Command Post!"
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_removeteamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		// *----------------------------------- vo ------------------------------------------*
	}

	trigger show_closed_cabinet
	{
		accum 0 abort_if_equal 1		// Closed cabinet active yet?
		setstate axis_cp_closed default
		setstate axis_cp_closed_model default
	}

	trigger show_damaged_cabinet
	{
		accum 0 abort_if_equal 0		// Damaged cabinet active yet?
		setstate axis_cp_damaged default
		setstate axis_cp_damaged_model default
	}
}


//------------------------------------------------------------------------
// objectives
//------------------------------------------------------------------------

//we have 2 objectives, taking the nuke and bringing them to the chopper:
vm_number_of_objectives 2 //we got 2 objectives

wm_set_objective_status 1 0 //setting obj 1 to axis status
wm_set_objective_status 2 0 //setting obj2 to axis status 0=axis 1=allied

wm_objective_axis_desc 1 "primary objective:**defend the depot door!!" //tell the axis to protect the door

wm_objective_axis_desc 2 "primary objective:**defend the nuke and return at all costs!!"

wm_objective_allied_desc 1 "blow the door to the depot"
wm_objective_allied_desc 2 "steal back the ^1NUKE ^7 and bring it to the chopper"

//wm_objective_image 1 "gfx/2d/objectives/door.tga"
//wm_objective_image 2 "gfx/2d/objectives/nuke.tga"
// these are the objectives picture that shows in the game menu

//wm_overwiev_image "video/something.roq" //a video?

//short descriptions

wm objective_short_axis_desc 1 "defend door"
wm_objective_short_axis_desc 2 "defend nuke"

wm_objective_short_allied_desc 1 "blow door"
wm_objective_short_allied_desc 2 "get nuke!"

// accum 1 for obj1 and accum2 for nmbr 2

accum 1 set 0
accum 2 set 0
}

and if i try to // that line it keeps going on with the next wm line…


(TomTom7777) #2

Try wm_number_of_objectives not vm_number_of_objectives…

And you are trying to set objectives before they are declared
you need declaration statements like

wm_objective_status 1 1 0 //or 1 0 1 …

before you use

wm_set_objective_status 1 x //not needed in the game manager spawn, use it in other events

AND
wm_objective_allied_desc should be in mapname.objdata not mapname.script
etc.

Use Chrukers scripting page as a guide to what keywords are available so you don’t try to mix in keywords reserved for other file types


(Qualmi) #3

lol. totally chaos :slight_smile:

did not had a too close look, but it is an scriptparse error :slight_smile: i have learned that this has sth to do with the brackets.

in addition i saw some faults you have done:

//we have 2 objectives, taking the nuke and bringing them to the chopper:
vm_number_of_objectives 2 //we got 2 objectives

must be turned into

//we have 2 objectives, taking the nuke and bringing them to the chopper:
wm_number_of_objectives 2 //we got 2 objectives

the complete section at the end of the script is a copy what you have already in your game_manager block asfai see. delete it :slight_smile:

hm…aaand i saw that you have placed trigger blocks without context. trigger command such as

trigger checkgame
{

accum 2 abort_if_not_equal 1
wm_setwinner 1
wait 1500
wm_endround
}

etc have to be written in an entity-block. they probably wont work if the are loosly hanging.

thats all i see so far. waiting for the crackers :cool:


(twt_thunder) #4

:o…#¤"#!"# i hate it…always typing something wrong…

and yes…total chaos…

i will delete the last part… it wasn’t supposed to be there…

thanx i’ll try again:confused:


(twt_thunder) #5

hm…aaand i saw that you have placed trigger blocks without context. trigger command such as

etc have to be written in an entity-block. they probably wont work if the are loosly hanging.

entity-block???
what’s that?

and now i get this error:
unknown action
wm_set_objective_status


(twt_thunder) #6

wm_objective_status <objective_number> <team> <objective_status>
Sets the tick or cross status overlay on the objective panel in the limbo menu for the specific objective, for the specified team.

or

wm_set_main_objective <objective_number> <team>
In the source code, this function does absolutely nothing at all.


(Qualmi) #7

entity-block???
what’s that?

entity-blocks are blocks which refer to entities you have set up in your editor. f.i. the allied_cp_open or the garagedoor blocks are entity-blocks. by typing

key: scriptname
value: nameitwhateveryouwant

to an entity in radiant, then this entity will search for a block called “nameitwhateveryouwant” in your script-file if sth happens to it during the map. thus the name entity-block.

the game_manager-block is also an entity-block.


(TomTom7777) #8

Normal structure of map script (Qualmi was faster this time)

game_manager {
   spawn {
   }
   trigger timelimit_hit {  //typical "event"
   }
   . . .
   trigger procedurename { //user defined procedure
   }
} //end game_manager

entity_scriptname {
   spawn {
   }
   entity_event { //example dynamite objective states (dynamited, defused, death)
   }
   . . .
   trigger procedurename { //user and some predefined procedures
   }
   . . .
} //end entity script block

All entities that have a scriptname can have an entity script block (if scriptname is unique then an unique block)
All script blocks can have a spawn “event”
Other events depend on entity type (see Chrukers page for entities and their events)
trigger keyword is mostly used for creating callable procedures in the entity blocks. If you want a procedure that does not relate to a specific entity then put it in game_manager. And don’t forget game_manager is the scriptname of the script_multiplayer entity.


(TomTom7777) #9

[QUOTE=thunderpwn;188084]wm_objective_status <objective_number> <team> <objective_status>
Sets the tick or cross status overlay on the objective panel in the limbo menu for the specific objective, for the specified team.

or

wm_set_main_objective <objective_number> <team>
In the source code, this function does absolutely nothing at all.[/QUOTE]

Yes I seem to recall that wm_set_main_objective was something that was to be used but wasn’t finished or something. I would use it anyway in case one of the mods does make use of it. and some mods do need the other objective commands like wm_objective_status etc, so it is not just a limbo menu thing.

Look at another well scripted map and copy the structure of the game_manager spawn script block. It will make your script file easier to read and debug.


(twt_thunder) #10

well, took away the objective stuff…atleast the door works with dynamite :smiley:

i will figure this out… coz i CAN steal the object, and i can return it to chopper…


(nUllSkillZ) #11

You could take a look at Ifurita’s site.
He has written a very good scripting tutorial.
There are also some prefabs.


(twt_thunder) #12

never mind… i fixed it :smiley:

when the tutorials are not correct…well read the helps i radiant and figure it out :smiley: :smiley:

here are the easiest objective script you ever saw…but it works!!

//objective
objective
{
spawn
{
wm_announce “allied have stolen the nuke”
}
death
{
wm_announce “allied has returned the nuke!!”
wm_setwinner 1
wait 1500
wm_endround
}
}


(shagileo) #13

And maybe you want that wm_announce changed into:

Allied team has stolen the nuke

and at death:

Allied team has secured the nuke (?)


(twt_thunder) #14

no…actually i have to drop the spawn thing…coz it comes up when the map starts…visit our server and you may try the beta…


(sherlock12) #15

Aion gold, Warhammer gold, as the currency in the Warhammer world, plays an important role in the economic system. The experience plays take in game kinda depends on how much Warhammer gold they have. To amateur players, they do not have much time to play the game, not even farming Warhammer online gold. So most of Warhammer players would like to purchase Warhammer gold.Warhammer cdkeyWarhammer online CD-key are the codes which be used to active your Warhammer Accounts. Warhammer leveling then will be needed after your Warhammer Accounts have been activated. That means you have to use both Warhammer CD-key and Warhammer Timecard after you creat an Warhammer account, so that you can access to the Warhammer world.


(Pande) #16

Oh brother…