Updating a old map: Trigger issue


(Mateos) #1

Hello,

I’m trying to fix 1944 Huertgen Forest… For now it is better on all points (Bug free, nothing’s missing, better performances), and I’m trying to add the flash and firing sound for the AT-Gun.

I tried to make it the Oasis way, with the speaker editor and all. The whole thingy, with the damage trigger check (Need 1 Axis at ATG, and both Tank and at least an Allied player at the target location to shoot), starts after Tank get stolen (accum 4 set to 1). Done this way, both flash/sound (I guess for sound, I don’ t ear it) are triggered only if an Axis player stands near ATG after Tank get stolen.

I checked the other entities, the ones working the way I want them… They’ve all the same scriptname (atg_blast) and the same targetname (atg_blast_boom), so I tried the same with the misc_model (Was expecting it to not work anyway…), added a target_speaker with also same scriptname/targetname, but doesn’t work…

I would like to know if I can make the flash and sound triggered only when what I said in second paragraph happens, but I don’t know how are working the triggers in the script… 3 days I’m on it so I finally post here.

Some details, such as map script related part:

// ************************************************
// ******************** AT GUN ********************
// ************************************************

aagun_1_model
{
	spawn
	{
		wait 200
		faceangles 0 195 0 300
	}
}

// atg_flash
// {
	// spawn
	// {
		// wait 150

		// setstate atg_flash invisible
	// }

	// trigger Yippie
	// {
		// setstate atg_flash default
		// trigger self sound_shot
		// wait 100
		// setstate atg_flash invisible
	// }

	// trigger sound_shot
	// {
		// togglespeaker atg_shoot_sound
	// }
// }

atg_smoke
{
	spawn
	{
		wait 300
		attachtotag aagun_1_destroyed Regroup04
		setstate atg_smoke invisible
	}
}

aagun_1_clip
{
	spawn
	{
		wait 200
		trigger aagun_1_clip setup
		constructible_class 3
	}
	trigger setup
	{
		setstate aagun_1_destroyed_clip invisible
		setstate aagun_1_destroyed 	invisible
		setstate aagun_1_model 		default
	}
	death
	{
		setstate aagun_1_destroyed_clip default
		setstate aagun_1_destroyed 	default
		setstate aagun_1_model 		invisible

		setstate atg_smoke default

		trigger 	at_blast destroyed

		wm_announce	"Allies have destroyed the Anti Tank Gun!"

		// *----------------------------------- vo ------------------------------------------*
		wm_removeteamvoiceannounce 	0 "1944_huertgen_axis_pak_defend"
		wm_removeteamvoiceannounce 	1 "1944_huertgen_allies_pak_destroy"

		wm_teamvoiceannounce 		0 "1944_huertgen_axis_pak_destroyed"
		wm_teamvoiceannounce 		1 "1944_huertgen_allies_pak_destroyed"
		// *---------------------------------------------------------------------------------*
	}
}

at_blast
{
	spawn
	{
		wait 300
		trigger at_blast setup
	}

	trigger setup
	{
		setstate at_blast_alliedtrigger invisible
	}

	trigger enable
	{
		accum 4 set 0
//		trigger atg_flash Yippie
		setstate at_blast_alliedtrigger default
	}

	trigger disable
	{
		accum 4 inc 1

		accum 4 abort_if_less_than 4

		setstate at_blast_alliedtrigger invisible
		setstate at_blast_boom 		invisible
	}

	trigger destroyed
	{
		setstate at_blast_alliedtrigger	invisible
		setstate at_blast_axistrigger	invisible
		setstate at_blast_boom		invisible
		setstate at_blast_toi		invisible
	}
}

at_blast_enable
{
	trigger check
	{
		trigger at_blast enable
	}
}

at_blast_disable
{
	trigger check
	{
		trigger at_blast disable
	}
}

The commented part, atg_flash, was for the misc_model. As said, did it like on Oasis :slight_smile: But doesn’t work the same way on this map…

The other entities are trigger_multiple (target = at_blast_boom) and several target_effect (And one target_speaker) = targetname at_blast_boom.

If you really need the map source or whole script, I’ll send it by PM…

I would like it to be complete, that’s the only thing left on to-do list, bot files and all are done… Just this :confused:


(thisisdynamic) #2

have u finished the map yet ??? i would love to try it out on my server


(Mateos) #3

Good evening,

Yes:
http://forums.warchestgames.com/showthread.php/32682-MAP-1944-Huertgen-Forest-(Final-2)-Released


(MaT3J) #4

Hi. At the beginning I want to point out that I do not know your map and I do not know the constructions you made, so it’s hard to me for make correct script, but I tried few changes. Anyway, you can make it way easier than you did already but I guess you don’t understand how accum works, etc.

Summarising, check it out but I don’t give you even 50% sure that this will work.

/ ************************************************
// ******************** AT GUN ********************
// ************************************************

aagun_1_model
{
	spawn
	{
		wait 200
		faceangles 0 195 0 300
	}
}

atg_flash
{
	spawn
	{
		wait 150
		setstate atg_flash invisible
	}

	trigger Yippie
	{
		trigger at_blast_enable check
		setstate atg_flash default
		trigger self sound_shot
		wait 100
		setstate atg_flash invisible
		trigger at_blast_disable check
	}

	trigger sound_shot
	{
		togglespeaker atg_shoot_sound
	}
}

atg_smoke
{
	spawn
	{
		wait 300
		attachtotag aagun_1_destroyed Regroup04
		setstate atg_smoke invisible
	}
}

aagun_1_clip
{
	spawn
	{
		wait 200
		trigger aagun_1_clip setup
		constructible_class 3
	}
	trigger setup
	{
		setstate aagun_1_destroyed_clip invisible
		setstate aagun_1_destroyed 	invisible
		setstate aagun_1_model default
	}
	death
	{
		setstate aagun_1_destroyed_clip default
		setstate aagun_1_destroyed 	default
		setstate aagun_1_model invisible
		setstate atg_smoke default
		trigger at_blast destroyed

		wm_announce "Allies have destroyed the Anti Tank Gun!"

		wm_removeteamvoiceannounce 	0 "1944_huertgen_axis_pak_defend"
		wm_removeteamvoiceannounce 	1 "1944_huertgen_allies_pak_destroy"

		wm_teamvoiceannounce 		0 "1944_huertgen_axis_pak_destroyed"
		wm_teamvoiceannounce 		1 "1944_huertgen_allies_pak_destroyed"
	}
}

at_blast
{
	spawn
	{
		wait 300
		trigger at_blast setup
	}

	trigger setup
	{
		setstate at_blast_alliedtrigger invisible
	}

	trigger enable
	{
		accum 1 set 1
		trigger atg_flash Yippie
		setstate at_blast_alliedtrigger default
		wait 5000 // optional
		
	}

	trigger disable
	{
		accum 1 set 0
		accum 1 abort_if_greater_than 1
		setstate at_blast_alliedtrigger invisible
		setstate at_blast_boom invisible
	}

	trigger destroyed
	{
		setstate at_blast_alliedtrigger invisible
		setstate at_blast_axistrigger invisible
		setstate at_blast_boom invisible
		setstate at_blast_toi invisible
	}
}

at_blast_enable
{
	trigger check
	{
		trigger at_blast enable
	}
}

at_blast_disable
{
	trigger check
	{
		trigger at_blast disable
	}
}

Greetings,
MaTeJ


(Mateos) #5

Hello,

I will upload the decompilated version of the original map, and you’ll just have to add this misc_model and place this file in etmain/sound/maps, and also sv_pure on 0 :slight_smile:

Why? Your edited script crashes the game without any prompt or nothing in console as soon as I reach the AT-Gun x) Just replaced the accum 1 to accum 6 (Blanck one).

Thanks in advance :slight_smile:

Edit: I may have placed myself the misc_model, duh >.>


(MaT3J) #6

Too complicated and too missing models, it’s too hard for me if I don’t see exactly what you want. I can only give few tips and I meant tutorials.

http://learningame.org/training_manual/pdf/Manual_Part_5_B.pdf
(Search the accum)
http://www.planetwolfenstein.com/tramdesign/tutorials/etdocs/

Anyway. I’m so sorry I can’t help you but try put yourself in my position, this is completely unknown map for me and you want that I create for you something though I have no idea what you want exactly. I just tried help you in my first post, because BELIEVE ME I know how to write scripts.
Maybe i’m too lazy, maybe not.

Greetings and good luck.


(Mateos) #7

You should get the map PK3 for textures/models, sorry I forgot about it:
http://wolffiles.de/filebase/ET/Maps/1944_huertgen_forest.zip

I used this to learn accums, I know they’re used for conditionals, I just don’t get how the way it is scripted it works ingame like this… Site is dead and not stored in Internet Archive but I post it anyway:
http://www.exasm.net/wessel/sites/wolfenstein_mapping/tutorials/specific/accums/index.html

I will read your links anyway, thanks :slight_smile:

Edit:
Have I do understand there’s pre-understood triggers like “spawn”, such as disabler/enabler? -_-


(MaT3J) #8

I have no idea when the ANTI-Tunk Gun should shoot, because there’s no button but only is the trigger SO I guess (You don’t understand how trigger works right? [trigger_multiple, etc.]) you need something like this probably:

[scriptname of trigger here]
{	spawn {
		setstate [scriptname/targetname of trigger from above here] default
		wm_announce "When map starts this will be default (VISIBLE)"
	}
	activate {
		setstate [scriptname/targetname of trigger from above here] invisible
		wm_announce "When player touch the trigger it will starts."
		wait 2000
		wm_announce "You can do it like (and you want I think), when Axis player touch this trigger and Allied player is in 'the Artillary Blast Area' then the script starts"
		wait 2000
		wm_announce "You can also make the 'func_invisible_user' for button to shoot this gun"
		wait 3000
		wm_announce "All others functions for this 'trigger_multiple', below/above here"
	}
}

Hope it will help.


(Mateos) #9

I described in first post when it can shoot.

activate is a specific command?

The goal is just to add a flash (misc_model) and sound when it shoots… If it’s too hard I’ll give up and release it as it is, all the other bugs are fixed and it’s optimized (No Hint at all in original x) ).


(acQu) #10

No, activate is just an event bound to an entity, for example a trigger_multiple can have that event.


(Mateos) #11

Good to know. I knew “spawn” and “run”, I have Venice in mind to see how I could make it work… Just have to figure how the way entities are linked and scripted it work like this.

Thanks :slight_smile:


(acQu) #12

No prob. You can recognize event routines the following way, just by looking at the general structure of the mapscript:

<scriptname of entity>
{
}

This example script routine can either have “event blocks” or “trigger blocks” in them (or instead of blocks you could call them subroutines). The trigger blocks can be recognized by them having the keyword “trigger”. For example this:

<scriptname of entity>
{
    trigger <somename>
    {
    }
}

All the other ones not prepended by the keyword trigger are events. Basically trigger routines are defined by yourself, while events are entry points, it works similar as Lua for example, where an event triggers a portion of the script (Lua embedded script events however are not strictly bound to entities).

Here a list of all entities and the events they can trigger: http://games.chruker.dk/enemy_territory/scripting_reference.php#entity_events

There is also a section for accums.

It has been a while since i learned all this, so i would probably be of no help, but for the theory part, you can always ask me. I know more or less everything about mapscripts :stuck_out_tongue:


(acQu) #13

No prob. You can recognize event routines the following way, just by looking at the general structure of the mapscript:

<scriptname of entity>
{
}

This example script routine can either have “event blocks” or “trigger blocks” in them (or instead of blocks you could call them subroutines). The trigger blocks can be recognized by them having the keyword “trigger”. For example this:

<scriptname of entity>
{
    trigger <somename>
    {
    }
}

All the other ones not prepended by the keyword trigger are events. Basically trigger routines are defined by yourself, while events are entry points, it works similar as Lua for example, where an event triggers a portion of the script (Lua embedded script events however are not strictly bound to entities).

Here a list of all entities and the events they can trigger: http://games.chruker.dk/enemy_territory/scripting_reference.php#entity_events

There is also a section for accums.

It has been a while since i learned all this, so i would probably be of no help, but for the theory part, you can always ask me. I know more or less everything about mapscripts :stuck_out_tongue:


(Mateos) #14

I’m still trying to mess around with that misc_model and target_speaker, I tried to adapt the Truck target_speaker entity and scripting part, but it’s looping. I don’t know how the at_blast is triggered, I can’t get what I add working the same way as the rest of entities. Maybe adding a wait value at the top of trigger disable will make it, will see… If not I’ll read and release it x)