a retrieval type obj for mohaa

Post your scripting questions / solutions here

Moderator: Moderators

Bloodshed
Private
Posts: 8
Joined: Wed Mar 10, 2004 10:54 pm

a retrieval type obj for mohaa

Post 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?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

script

Post 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?
Tom Trude,

Image
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post 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 =)
When I am king, you will be first against the wall~
Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

crash

Post 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.
Tom Trude,

Image
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post 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...
"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
Bloodshed
Private
Posts: 8
Joined: Wed Mar 10, 2004 10:54 pm

Post 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
Bloodshed
Private
Posts: 8
Joined: Wed Mar 10, 2004 10:54 pm

Re: crash

Post 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?
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post 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
}
When I am king, you will be first against the wall~
Image
Bloodshed
Private
Posts: 8
Joined: Wed Mar 10, 2004 10:54 pm

Post by Bloodshed »

i couldnt get the nuggetts code to work and i dont understand the code from Axion.. :?
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
}
hope this helps, prob not cos it's all foreign 2 me :-/
Bloodshed
Private
Posts: 8
Joined: Wed Mar 10, 2004 10:54 pm

Post 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
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
Bloodshed
Private
Posts: 8
Joined: Wed Mar 10, 2004 10:54 pm

Post by Bloodshed »

any luck nuggets? :D
Bloodshed
Private
Posts: 8
Joined: Wed Mar 10, 2004 10:54 pm

Post by Bloodshed »

*bump*

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