Scripting question #347347478347


(neotic) #1

Heh, this is probably a very simple answer… but I really am not sure how to go about it. I have a forward spawn point with a checkflag; it works great right now. But what I need is to not have it be captureable till other things have occured; say an explosion.

I’d like to make it captureable after the following routine’s trigger. So naturally I’d have the trigger set some accum to some value. But how to i make a whole forward_spawn not exist and then pop out of no where? Or is it just a matter of keeping it in existance but making it not captureable some how? This is where I get lost…

palace_gate
{
	spawn
	{
		setstate palace_gate default
	}
	
	trigger palace_gate_invis
	{
		setstate palace_gate invisible
	}
}

Here is my forward spawn if you want ot refernce it or something!~ hehe /shrug

forward_spawn
{
	spawn
	{
		accum 0 set 1	// Who has the flag: 0-Axis, 1-Allied
	}

	trigger allied_capture
	{
		accum 0 abort_if_equal 1 // do Allies own flag?
		accum 0 set 1

		setstate house_spawns default
		setstate house default

		alertentity house_obj

		setautospawn	"Old Village"		1
		setautospawn	"Palace Spawn"		0
		
		accum 2 set 1

		wm_announce	"*^1Allies have secured the Old Village!^7"
	}
	
	trigger axis_capture
	{
		accum 0 abort_if_equal 0 // do Axis own flag?
		accum 0 set 0

		setstate house_spawns default
		setstate house default
		
		alertentity house_obj
		
		setautospawn	"Fortress Towers"	1
		setautospawn	"Old Village"		0
		
		wm_announce	"*^1Axis have captured the Old Village and if held for 2 minutes will be Axis permanently!^7"
		
		wait 200
		
		accum 2 set 0
		
		trigger forward_spawn timer
	}
	
	trigger timer
	{
		accum 2 abort_if_equal 1 // Do Allies own flag?
		wait 30000
		trigger forward_spawn timer1
	}

	trigger timer1
	{
		accum 2 abort_if_equal 1 // Do Allies own flag?
		wm_announce	"*^1Axis have now owned the Old Village for 30 seconds!^7"
		wait 30000
		trigger forward_spawn timer2
	}

	trigger timer2
	{
		accum 2 abort_if_equal 1 // Do Allies own flag?
		wm_announce	"*^1Axis have now owned the Old Village for 1 minute!^7"
		wait 30000
		trigger forward_spawn timer3
	}

	trigger timer3
	{
		accum 2 abort_if_equal 1 // Do Allies own flag?
		wm_announce	"*^1Axis have now owned the Old Village for 90 seconds!^7"
		wait 30000
		trigger forward_spawn timer4
	}

	trigger timer4
	{
		accum 2 abort_if_equal 1 // Do Allies own flag?
		wm_announce	"*^1The Old Village is now permanently owned by Axis!^7"

		trigger forward_spawn kill
	}
	
	trigger kill
	{
		remove				// Remove self (flag model)
	}

}

I sure hope there wasnt another topic about this because I couldn’t find it. :smiley:

Thanks in advance.

Oh and Drakir… if that timer script looks familiar… it is. Check your hotmail email lol. :smiley:


(LaggingTom) #2
palace_gate 
{ 
   spawn 
   { 
      setstate palace_gate default 
   } 
    
   trigger palace_gate_invis 
   {
      trigger forward_spawn blargh 
      setstate palace_gate invisible 
   } 
}
forward_spawn 
{ 
   spawn 
   {
      setstate forward_spawn invisible 
      accum 0 set 1   // Who has the flag: 0-Axis, 1-Allied 
   } 

   trigger allied_capture 
   { 
      accum 0 abort_if_equal 1 // do Allies own flag? 
      accum 0 set 1 

      setstate house_spawns default 
      setstate house default 

      alertentity house_obj 

      setautospawn   "Old Village"      1 
      setautospawn   "Palace Spawn"      0 
       
      accum 2 set 1 

      wm_announce   "*^1Allies have secured the Old Village!^7" 
   } 
    
   trigger axis_capture 
   { 
      accum 0 abort_if_equal 0 // do Axis own flag? 
      accum 0 set 0 

      setstate house_spawns default 
      setstate house default 
       
      alertentity house_obj 
       
      setautospawn   "Fortress Towers"   1 
      setautospawn   "Old Village"      0 
       
      wm_announce   "*^1Axis have captured the Old Village and if held for 2 minutes will be Axis permanently!^7" 
       
      wait 200 
       
      accum 2 set 0 
       
      trigger forward_spawn timer 
   } 
    
   trigger timer 
   { 
      accum 2 abort_if_equal 1 // Do Allies own flag? 
      wait 30000 
      trigger forward_spawn timer1 
   } 

   trigger timer1 
   { 
      accum 2 abort_if_equal 1 // Do Allies own flag? 
      wm_announce   "*^1Axis have now owned the Old Village for 30 seconds!^7" 
      wait 30000 
      trigger forward_spawn timer2 
   } 

   trigger timer2 
   { 
      accum 2 abort_if_equal 1 // Do Allies own flag? 
      wm_announce   "*^1Axis have now owned the Old Village for 1 minute!^7" 
      wait 30000 
      trigger forward_spawn timer3 
   } 

   trigger timer3 
   { 
      accum 2 abort_if_equal 1 // Do Allies own flag? 
      wm_announce   "*^1Axis have now owned the Old Village for 90 seconds!^7" 
      wait 30000 
      trigger forward_spawn timer4 
   } 

   trigger timer4 
   { 
      accum 2 abort_if_equal 1 // Do Allies own flag? 
      wm_announce   "*^1The Old Village is now permanently owned by Axis!^7" 

      trigger forward_spawn kill 
   } 
    
   trigger kill 
   { 
      remove            // Remove self (flag model) 
   } 

   trigger blargh
   {
      setstate forward_spawn default
   }

}

Feel free to rename BLARGH as you please :slight_smile:


(neotic) #3

Ha! Thank you much mate! Gonna try this out now… guess I should have just played around more. Oh well, thanks again!