Page 1 of 2

a retrieval type obj for mohaa

Posted: Wed Mar 10, 2004 10:55 pm
by Bloodshed
i would like to have it so the allies have to steal documents and get back in the boat and once there in the boat - objective achieved.. all i have so far is the docs tut from rhujkan project in my script, can anyone be of assistance on accomplishing this obj?

script

Posted: Thu Mar 11, 2004 6:19 am
by tltrude
If you want help, you have to give all the facts, or at least post your script.

It could probably be done with a trigger_multiple on the boat with a targetname of "win_check_trigger" or something like that. That trigger would have a key: setthread and Value: win_check . The thread in the script would then check to see if the documents had been picked up and give the command "teamwin allies".

Another thing to think about is, what happens to the documents, if the guy carrying them gets killed before reaching the boat?

Posted: Thu Mar 11, 2004 10:38 am
by Splaetos
for an alternative objective to my liberation map I am goign to do something like this.

I think I will be placeing some documents or something similar on a corpse in one of the cells. When the allies get the objective, they must bring it back to the exit, where there will be a trigger multiple checking for it. It will attach to the player carrying it, like flags in some ctf matches(or identify them in some other way not sure yet. Since respawning will be on, I will have a timer on axis players holding the obj once they retrieve it(returning it to its origin) but no timer(or a very long one, on how long it can stay on the ground if the player is killed and drops it, so that allies do not have to brak into the most defensible portion of the map everytime the carrier is killed.

Alot of scripting for stuff like this is in CTF maps, or in CTF mods(like mefy's) you should check those out for ideas on players carrying and moving objects, as well as scoring and moving the object in cases of death or whatever. Basicaly CTF is jsut the most common version of what you are trying to accomplish, but usualy the object is a flag, and each team has one =)

Posted: Thu Mar 11, 2004 2:20 pm
by nuggets
keeping it simple, i haven't read the script for it but if you want to have to take them back you'll need a little extra, have two triggers the first one trigger_use targetname/documents_trigger and the second trigger_multiple targetname/win_check

main:
$documents_trigger glue $documents
thread taking
thread did_we_win
end

taking:
$documents_trigger waittill trigger
parm.other.holder = 1
$documents_trigger nottriggerable
$documents hide
$documents glue parm.other
while (isAlive parm.other)
{
waitframe
}
$documents droptofloor
parm.other.holder = 0
$documents_trigger triggerable
$documents show
goto taking

did_we_win:
$wincheck waittill trigger
if (parm.other.holder == 1)
{
teamwin allies
end
}
else
{
wait 1
goto did_we_win

crash

Posted: Thu Mar 11, 2004 2:44 pm
by tltrude
Well that will crash because nuggets forgot a bracket at the end. It is also not very fair for the axis team because they can't tell which allied player has the documents. I don't think you can glue a hidden document to a player, anyway. But, the basic concept is all there.

Posted: Thu Mar 11, 2004 3:56 pm
by Axion
Here is part of the script from the objective version of Palermo, where the Axis have to read a map and make it back to base in order to win-

Code: Select all

//*** --------------------------------------------
//*** This player has to run home to win
//*** --------------------------------------------

view_map local.player:

	if ( local.player.dmteam != "axis" ) {
		end
	}

	if ( ! (local.player cansee $map 60 80) ) {
		end
	}

	if ( local.player.seenMap == 1 ) {
		local.player iprint ( loc_convert_string "You've memorized the map! Run the back to the headquarters!!!" )
		// local.player iprint ( loc_convert_string ( local.player.netname + " has already memorized the map!!!" ) )
		end
	}

	local.player thread run_home_to_win
end

setCompass:
	for (local.i = 1; local.i <= $player.size; local.i++)
	{
		if ( ! (Isalive $player[local.i] ) )
			continue
		if ( $player[local.i].dmteam != "axis" )
			continue
		if ( $player[local.i].seenMap != 1 )
			continue
		set_objective_pos $AxisHQ[1]
		end
	}
	set_objective_pos $map
end

run_home_to_win:

	self.seenMap = 1

	set_objective_pos $AxisHQ[1]

	iprintln ( loc_convert_string ( self.netname + " has a copy of the Allies map!" ) )
	self iprint ( loc_convert_string "You've memorized the map! Run the back to the headquarters!!!" )

	while ( self != NULL )
	{
 		if ( ! (Isalive self) )
		{
			iprintln ( loc_convert_string "The Axis spy has been killed!" )
			self.seenMap = 0
			thread setCompass
			end
		}

		if ( self.dmteam != "axis" )
		{
			iprintln ( loc_convert_string "Axis spy has defected!" )
			self.seenMap = 0
			thread setCompass
			end
		}

		for (local.i = 1; local.i <= $AxisHQ.size; local.i++) {
			if ( self isinside $AxisHQ[local.i] )
			{
				iprintln ( loc_convert_string "The Axis has won!" )
				thread AxisVictory
				end
			}
		}

		wait 0.1
	}
	iprintln ( loc_convert_string "The Axis spy has vanished!" )
end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

AxisVictory:

	teamwin axis

end

axis_win_bomb:

	level waittill axiswin

end

//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------

allied_win_timer:

	level waittill allieswin

end

Maybe that will give you some ideas...

Posted: Thu Mar 11, 2004 8:53 pm
by Bloodshed
sorry for the vagueness but i didnt have any of this obj scripted so thats why i didnt post script i just was wondering if this kind of obj was possible

my idea was to have allies steal the documents and have to return them to the boat to win, knowing who has the docs would be cool but im unsure if thats even possible and if the person with the docs gets killed id like it so theyd return to where they were... im gonna give your guys suggestions a try, im a novice at best so any help would be very appreciated.. thanx

Re: crash

Posted: Fri Mar 12, 2004 2:31 am
by Bloodshed
tltrude wrote:Well that will crash because nuggets forgot a bracket at the end. It is also not very fair for the axis team because they can't tell which allied player has the documents. I don't think you can glue a hidden document to a player, anyway. But, the basic concept is all there.
wheres the bracket missing at?

Posted: Fri Mar 12, 2004 4:10 am
by Splaetos
did_we_win:
$wincheck waittill trigger
if (parm.other.holder == 1)
{
teamwin allies
end
}
else
{
wait 1
goto did_we_win


should be

Code: Select all

did_we_win: 
$wincheck waittill trigger 
if (parm.other.holder == 1) 
{ 
teamwin allies 
end 
} 
else 
{ 
wait 1 
goto did_we_win
}

Posted: Tue Mar 16, 2004 12:02 am
by Bloodshed
i couldnt get the nuggetts code to work and i dont understand the code from Axion.. :?

Posted: Tue Mar 16, 2004 1:12 am
by nuggets
nuggets wrote:keeping it simple, i haven't read the script for it but if you want to have to take them back you'll need a little extra, have two triggers the first one trigger_use targetname/documents_trigger and the second trigger_multiple targetname/win_check

main:
$documents_trigger glue $documents
thread taking
thread did_we_win
end

taking:
$documents_trigger waittill trigger
parm.other.holder = 1
$documents_trigger nottriggerable
$documents hide
$documents glue parm.other
while (isAlive parm.other)
{
waitframe
}
$documents droptofloor
parm.other.holder = 0
$documents_trigger triggerable
$documents show
goto taking

did_we_win:
$wincheck waittill trigger
if (parm.other.holder == 1)
{
teamwin allies
end
}
else
{
wait 1
goto did_we_win
}

Posted: Wed Mar 17, 2004 2:11 am
by Bloodshed
nuggets, finally got it to work...

couple things... if u dont get out of the room in a sec round ends (we only got to further test it by kill in console right after grabbing.. which is another thing.. u die u keep docs :?), axis can grab it, if u press use on the docs on the person's foot round ends... if u could please help me further with this scripting would be very much appreciated as im a noob with this scripting stuff :D

Posted: Wed Mar 17, 2004 3:51 am
by nuggets
i'll have a look tomorow, prob something really simple but can't see it right now, it's too late at night :(

3:40am

Posted: Sat Mar 20, 2004 6:20 pm
by Bloodshed
any luck nuggets? :D

Posted: Tue Mar 30, 2004 5:15 am
by Bloodshed
*bump*

anyone else out there kno how to complete this? nuggets forgot bout me :cry: 8-)