dual objectives like Gold Rush


(Jerkey) #1

I’m sure its an easy fix, but here’s my question that I can’t get past: :banghead:

I can’t seem to figure out how the gold bars in the bank on “Gold Rush” will reappear when they are dropped off in the truck the first time.

I am able to have the gold bars as the “team_CTF_blueflag” and have it be captured and delivered to its proper place. But I want to be able to have it reappear to be picked up again.

I’ve tried making 2 “team_CTF_blueflag” and giving each a scriptname to script one to be invisible at the beginning, then appear when the first box is dropped off…but it doesn’t seem to be working.

Any tips on this?

Thanks a bunch, you mapping geniuses!

~Jerkey


(Lightning) #2

You need to change the count property:

Key: count
Value: 2

Change the value depending on how many gold bars you want to have.


(Ifurita) #3

In order to setstate a CTF_*flag invisible, you’ll have to alertentity it in game_manager first


(Ifurita) #4

Go to pcgamemods.com, find the et map called tactical_final and take a look at the script in that.


(Jerkey) #5

Right on! Thanks for the help, folks. Y’all just recharged your Karma. You can go and do something bad now…and it’ll all even out.

Peace!

Wait…I just want to make sure I have this right. A simple answer to my issue is most likely going to be setting the “count” key…Thanks, Lightning!

But, Iffy (and might I say I’ve been reading your posts from years ago for the past 2 months trying to wrap mapping around my head) the “alertentity” command in the script is a specific command for the “team_CTF_blueflag” (or redflag) or is it a command for all entities? By looking at the script, it seems as if it is a command to “wake up” an entity (specifically a TEAM entity?). Then the entity is active to perform a routine?

Thanks again!

~Jerkey


(Jerkey) #6

OK…I’m able to have the gold bars reappear by putting in the “count” value. But now it reappears immediately after I grab it. I’d like it to be invisible until I drop the gold bars off in the truck.

So I figured I’d try to use the “alertentity” command in the script to try to make the"team_CTF_blueflag" invisible until it is secured. (I’m using “alertentity” in the spawn of the game_manager then “setstate” in the “trigger stolen” and “returned” and “captured” scripts of my “team_CTF_blueflag” script, named gold_bars) But now I’m getting the message that I need a “use” function on the “team_CTF_blueflag” entity. ??? I’m not getting any error messages when I put the “alertentity” in the gold_bars script …but then again, its not working either!

I can’t seem to find any entry of the “use” function in the documentation, nor is it in the goldrush script. I checked out your tactical_final map, Iffy, but there is no .map file to be able to look at your entity values. Any ideas?

Thanks!
~Jerkey


(Ifurita) #7

the map file for tactical is here: http://www.worldwidegaming.org/developer/source_maps/tactical_final_source.zip

In tactical, the obj only appears once the course is completed:


trigger game_reset
	{
		wm_announce "Arena Resetting"	

		setstate area1_hurt invisible
		setstate area2_hurt invisible
		setstate area3_hurt invisible
		setstate area4_hurt invisible
		setstate area5_hurt invisible

		setstate token_cm_marker default 
		setstate token_allied default //<----- makes objective visible again
		setstate token_axis default

		accum 0 set 0 
		globalaccum 0 set 0

		resetscript
	}
} 

and


// ==============================================================
// Run Token (Allied)
// ==============================================================

token_allied
{ 
	spawn 
	{ 
		wait 200 
		trigger self startup
	} 

	trigger stolen 
	{ 
		wm_announce "Run Starting" 
		setstate token_cm_marker invisible 
		setstate token_allied invisible
		setstate token_axis invisible

		alertentity timer

		trigger door1_left open
		trigger door1_right open

		wait 3000

		trigger door1_left closed
		trigger door1_right closed
	} 

	trigger dropped
	{
		alertentity timer

		wm_announce "Run Terminated"
		trigger game_manager game_reset
	}

	trigger returned 
	{ 
	} 

	trigger captured 
	{ 
		wm_announce "Run Successfully Completed"
		alertentity timer
		trigger time_counter time_output

		wait 2000

		trigger game_manager game_reset
	} 

	trigger startup
	{
		setstate token_allied default
		setstate token_axis default
		setstate token_cm_marker default 
	}	
} 

// ==============================================================
// Run Token (Axis)
// ==============================================================

token_axis
{ 
	spawn 
	{ 
		wait 200 
		trigger self startup
	} 

	trigger stolen 
	{ 
		wm_announce "Run Starting" 
		setstate token_cm_marker invisible 
		setstate token_allied invisible //<--- makes objective invisible once stolen, until the arena resets
		setstate token_axis invisible

		alertentity timer

		trigger door1_left open
		trigger door1_right open

		wait 3000

		trigger door1_left closed
		trigger door1_right closed
	} 

	trigger dropped
	{
		alertentity timer

		wm_announce "Run Terminated"
		trigger game_manager game_reset
	}

	trigger returned 
	{ 
	} 

	trigger captured 
	{ 
		alertentity timer
		trigger time_counter time_output

		wm_announce "Run Successfully Completed"

		wait 2000

		trigger game_manager game_reset
	} 

	trigger startup
	{
		setstate token_allied default
		setstate token_axis default
		setstate token_cm_marker default 
	}	
} 


(Jerkey) #8

Thanks a ton, Iffy! I think I got it fugured. However, when I put the alertentity in the spawn of the game_manager, it hangs up. But when I use it in the scripts right before I setstate on the team_CTF_blueflag, it works.

Anyway, it works now, and I thank you a bunch. Also, I got some good ideas from your .map file. If I release anything, I’ll make sure to give you your well-earned props.

Peace!