Capturable Spawnpoint


(Dark Killer) #1

Ok I created a spawnpoint which can be captured by both team and whoever captures it spawns there, it works very good but I got one problem, it doesn’t show up on the command up so you always spawn there, and how can I make somebody to choose from where to spawn like my default spawn in a room where there is no capturable flags or anything or near that captured flag?


(sock) #2

http://www.splashdamage.com/forums/viewtopic.php?t=2973

Sock
:moo:


(red) #3

I got it all working now, thanks drakir & sock. 1 Thing remains, how to set it up so, that Axis owns it in the beginning and starts there? (Now they start from the first spawn, and i wanna make em start from the flag)


(sock) #4

Here is a collection of working forward spawn example map files and scripts:

Initially Allies controlled: http://www.planetquake.com/simland/ldr1_1/samplemap07a.htm
Initially Axis controlled: http://www.planetquake.com/simland/ldr1_1/samplemap07b.htm
Permenant switch: http://www.planetquake.com/simland/ldr1_1/samplemap07c.htm

Sock
:moo:


(red) #5

I now created everything again, accordingly to the “Permanent Switch” but theres still 1 bug. Now when the fence gets blown, the forward spawn is left for the team that has it at that moment, even if in the script theres setautospawn (i didn’t even touch it, its the original). I copied the values & keys from the map file and everything else works fine. You need the script or could you point out what i could possibly be doing wrong?
(the only thing i edited in the script, was the objective name)
edit: I decided to enter the part of the script too, just in case:

// ============================================================================
// Forward Spawn point - Initially owned by Axis
//
// ============================================================================
forwardspawn1_flag
{
spawn
{
accum 0 set 0 // Who owns flag: 0-Axis, 1-Allied
}

trigger axis_capture // Touched by an Axis player
{
accum 0 abort_if_equal 0 // do Axis own flag?

accum 0 set 0 // Axis own the flag
wm_announce "Axis reclaim the Forward Spawn!"

alertentity forwardspawn1_wobj // Switch command map marker
setautospawn "Forward Spawn" 0 // Set Axis to forward spawn
}

trigger allied_capture // Touched by an allied player
{
accum 0 abort_if_equal 1 // do Allies own flag?

accum 0 set 1 // Allied own the flag
wm_announce "Allies capture the Forward Spawn!"

alertentity forwardspawn1_wobj // Switch command map marker
setautospawn "Forward Spawn" 1 // Set Allies to forward spawn
}

trigger force_allied
{
accum 0 abort_if_equal 1 // Do Allies own the flag?
alertentity forwardspawn1_wobj // Switch command map marker
alertentity forwardspawn1_spawns // Switch all spawnpoints
setautospawn "Forward Spawn" 1 // Set Allies to forward spawn
}
trigger kill
{
remove // Remove self (flag model)
}
}

fence
{
spawn
{
wait 200 // Wait for all entities to spawn
constructible_class 3 // Dynamite only
}

death
{
trigger forwardspawn1_flag force_allied // Switch forward spawn to Allied ONLY
trigger forwardspawn1_flag kill // Remove entities
setstate forwardspawn1_base invisible // Remove base of flag

wm_announce "Allies have breached the perimeter fence!"
}
}

(seven_dc) #6

H!i nice to see you here red!

I think that you must set the autospawn in your fence’s death part.

I assume that the allies will get the spawn point when the fence is destroyed. Am I right?

I would do the following:

I am not 100% sure this work but I think it is worth checking out.


death
{
alertentity forwardspawn1_wobj		// Switch command map marker
setautospawn "Forward Spawn"	1	// Set Allies to forward spawn
trigger forwardspawn1_flag force_allied // Switch forward spawn to Allied ONLY
trigger forwardspawn1_flag kill // Remove entities
setstate forwardspawn1_base invisible // Remove base of flag

wm_announce "Allies have breached the perimeter fence!"
} 


basically I added the allied capture commands in fence’s death before other commands.


spanish girl Webcam


(sock) #7

The script looks fine and I cannot see any errors in it. But a few questions.

When the fence is destroyed do you get the message “Allies have breached the perimeter fence!” ? If not then the death function is not being run properly and the fence entity needs to have a targetname/scriptname key.

Now when the fence gets blown, the forward spawn is left for the team that has it at that moment,

That sounds like either the death function is not being run or the forwardspawn functions are not being run or the forward spawn flag entities are not named correctly.

Ok, did the original sample map work how you wanted it?
Did you name all the entities correctly in your map? Double check the spawnflag entities are correct.

Sock
:moo:


(red) #8

seven_dc, I’ll try your script when i get home, thanks.
sock: I do get the message, and the flag disappears like it should, BUT the setautospawnpoints isn’t working I think (because the team who has the flag when the dynamite explodes, gets to keep the spawn). I’ll double check everything and if I find no error I’ll create them from a scratch and see where I get. Also, I got Myrkky helping me so maybe I’ll wait for what he says… Possibly just a small glitch, but we’ll see. I’ll report here of the outcome :slight_smile:

edit: and I even get the message twice, 'cos the dynamite destroyes the barbed wire on top of the fence also, but I can’t be arsed to fix it just yet. :wink:


(sock) #9

I do get the message, and the flag disappears like it should, BUT the setautospawnpoints isn’t working I think (because the team who has the flag when the dynamite explodes, gets to keep the spawn)

Sounds like the force_allied function is not working correctly. If the axis have control of the spawn point when the fence is destoyed the axis spawnpoints should be switched off and the allies spawnpoints switched on. All the spawnpoints connected to the forward spawn have to be manually switched.

trigger force_allied 
{ 
accum 0 abort_if_equal 1 // Do Allies own the flag? 
alertentity forwardspawn1_wobj // Switch command map marker 
alertentity forwardspawn1_spawns // Switch all spawnpoints 
setautospawn "Forward Spawn" 1 // Set Allies to forward spawn 
}

The command map icon should disappear ? yes/no - if this works then we know that this function is being executed. (Good sign)
The spawnpoints should be switched? If not then the spawnpoints have the wrong targetname. This script says they should all be called “forwardspawn1_spawns” right?

Sock
:moo:


(red) #10

I remember the command map icon disappearing from the team that did’nt have the flag when the fence blew up, and ofcourse it stays for the team who had it at that time. So presuming from that the script IS working and the problem is in the spawnpoints’ keys & values. I’ll double check the spawnpoints’ targetnames. I might of copypasted the wrong then, not sure. Im at school now so I’tl be 4 hours before i can go check them. Sock: If they are right ill PM you with an FTP address and you can check them also if you wish. Hope i get it wekkin’ before evening when ive scheduled alpha testing for the map. :slight_smile:


(red) #11

Got it working, i don’t understand where the glitch was. I just recreated everything from a scratch and it started werkkin’. Thanks for help tho :slight_smile:


(red) #12

OK, 1 last question about this topic. I have multiple spawn points for each team, but you can’t choose them because your team has the flag it forces you to spawn there, even if you choose another spawnpoint from the limbo menu. Heres the script

//autospawn
//
//{
//setautospawn "Axis Spawn" 0 
//setautospawn "Allies Spawn" 1
//}

// ============================================================================
// Forward Spawn point - Initially owned by Axis
//
// ============================================================================
forwardspawn1_flag
{
	spawn
	{
		accum 0 set 0 // Who owns flag: 0-Axis, 1-Allied
	}

	trigger axis_capture // Touched by an Axis player
	{
		accum 0 abort_if_equal 0  // do Axis own flag?
		accum 0 set 0  // Axis own the flag
		wm_announce "Axis reclaim the Forward Spawn!"
		alertentity forwardspawn1_wobj // Switch command map marker
		setautospawn "Forward Spawn"0 // Set Axis to forward spawn
	}

	trigger allied_capture // Touched by an allied player
	{
		accum 0 abort_if_equal 1  // do Allies own flag?
		accum 0 set 1  // Allied own the flag
		wm_announce "Allies capture the Forward Spawn!"
		alertentity forwardspawn1_wobj // Switch command map marker
		setautospawn "Forward Spawn"1 // Set Allies to forward spawn
	}

	trigger force_allied
	{
		accum 0 abort_if_equal 1  // Do Allies own the flag?
		alertentity forwardspawn1_wobj // Switch command map marker
		alertentity forwardspawn1_spawns // Switch all spawnpoints
		setautospawn "Forward Spawn"1 // Set Allies to forward spawn
	}
	
	trigger kill
	{
		remove // Remove self (flag model)
	}
}

dynamiteobj1
{
spawn
{
wait 200 // Wait for all entities to spawn
constructible_class 3 // Dynamite only
}

death
{
trigger forwardspawn1_flag force_allied // Switch forward spawn to Allied ONLY
trigger forwardspawn1_flag kill // Remove entities
setstate forwardspawn1_base invisible // Remove base of flag

wm_announce "Allies have breached the perimeter fence!"
}
}

So what im looking for is the possibility to choose in wich spawn you spawn. If my english is hard to understand I’ll try to explain it in other words. Help! :slight_smile:


(Ifurita) #13

heh, i ran into the same problem. the allies also spawned at the flag after it was captured. still looking for a fix


(red) #14

Mine works well in other parts, even if other team captures it etc. I’m really wishing to find the solution soon because the map is almost done and this is the only thing thats keeping me from publishing it. :slight_smile:

btw Ifurita: I’ve noticed your prefabs are @ fileplanet and laying there they do no good for anyone. Nobody wants to pay from it, get a free host, there are some. :slight_smile:


(Ifurita) #15

you can download files from fileplanet for free. Page down once and you’ll see the public servers.


(red) #16

^BUMB^

I know someone knows what I’m talking about. Sock?