Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → MP Lobby Teleportation, etc.
MP Lobby Teleportation, etc.
2004-05-01, 7:02 AM #1
Can someone write me a cog for a switch that's disabled when activated and teleports the activated player to one ghost and changes his model, team, and spawn, while another switch can be activated by any number of players and teleports them to a different ghost and changes their models, team, and spawn?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-05-01, 12:32 PM #2
You might want to explain that clearer, or is it just me?

------------------
Nightfire Mod
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-05-01, 3:26 PM #3
It's just you.

Couldn't you simply put the team cogs for CTF into a switch?

JediKirby

------------------
"I was driving along listening to the radio, when Judas Priest comes on. It was 'You've got another thing coming.' All of a sudden, I enter 'VICE CITY RAMAGE MODE' and nearly ran some guy over"
- ]-[ellequin
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2004-05-01, 4:25 PM #4
Unless I misunderstood, that code already exists in the CTF cogs... Just modify one and make it operate on a switch...

------------------
I used to believe that we must fight the future, lest change come without our consent. I was wrong. The truth is that we must embrace the future, for only with change can we remain the same.
And when the moment is right, I'm gonna fly a kite.
2004-05-02, 5:42 AM #5
this one may work for you.
i took the CTF code and modified it to do what you wanted.
Code:
##########################################################
# Jedi Knight Cog Script  (JK)
#---------------------------------------------------------
# LOBBY_TELE01.COG
# -RED_SWITCH is disabled when activated.
# -GOLD_SWITCH can be used as many times as needed.
# -Teleports the player that activates the switch to a
#  ghost, changes his model, team, and spawn points.
#---------------------------------------------------------
# Written By DSLS_DeathSythe
# This COG is NOT supported by LucasArts Entertainment Co.
##########################################################
symbols
#---------------------------------------------------------
message     startup
message     activated
message     join
message     timer
#--------------------#
surface     red_switch=-1
surface     gold_switch=-1

model       red_mdl=kyX0.3DO
model       gold_mdl=kyU0.3DO

thing       red_start=-1                                  nolink
thing       gold_start=-1                                 nolink
#--------------------#
thing       player=-1                                     local
thing       senderRef=-1                                  local

template    teleport_particles=+telesparks                local
sound       teleport_snd=ForceThrow01.WAV                 local
sound       act_snd=activate01.WAV                        local
sound       click_snd=lgclick1.WAV                        local

thing       dummy=-1                                      local

int         is_on=0                                       local
#---------------------------------------------------------
end
#=========================================================
code
#---------------------------------------------------------
startup:
	player = GetLocalPlayerThing();

	//-SERVER ONLY startup:
	if(IsServer() || !IsMulti())
		{
		//-Team mode                   (1)
		//-No damage to teammates      (2)
		//-No custom costumes         (20)
		SetMultiModeFlags(0x23);

		//-Auto assign teams          (100)
		//-This also disallows the command to change teams
		ClearMultiModeFlags(0x100);

		//-Because team mode might have assigned the server player to team 1
		SetPlayerTeam(player, 0);

		is_on = 0;
		}

	//-CTF Team
	SetPlayerTeam(player, 0);

	//-The player can only spawn on 16 to 31 the first time
	SetRespawnMask(player, 0x0000FFFF);
return;
#---------------------------------------------------------
join:
	player = GetSenderRef();
	SetPlayerTeam(player, 0);
	//-The player can only spawn on 16 to 31 the first time
	SetRespawnMask(player, 0x0000FFFF);
return;
#---------------------------------------------------------
activated:
	//-Exit if activated: was sent by anything else than a surface
	if(GetSenderType() != 6) return;

	player = GetSourceRef();
	senderRef = GetSenderRef();

	//-These are the Team selection surfaces.
	//-The player is marked with the correct color, then teleported into the game.

	//-This switch is disabled once it has been activated.
	if(senderRef == red_switch)
		{
		//-If the switch has already been used dont let any one else use it.
		if(is_on == 1)
			{
			PlaySoundPos(click_snd, GetSurfaceCenter(red_switch), 1.0, -1, -1, 0x0);
			return;
			}
		is_on = 1;
		SetWallCel(red_switch, 1);
		PlaySoundPos(act_snd, GetSurfaceCenter(red_switch), 1.0, -1, -1, 0x0);

	      SetPlayerTeam(player, 1);

		// Give the player a red costume
		SetThingModel(player, red_mdl);

		AddDynamicTint(player, 0.0, 0.75, 0.0);
		StopThing(player);
		TeleportThing(player, red_start);
		dummy = CreateThing(teleport_particles, player);
		PlaySoundThing(teleport_snd, player, 1.0, -1, -1, 0x80);

		// spawnpoints 0 to 7 are RED, so it is 0xFFFFFF00
		SetRespawnMask(player, 0xFFFFFF00);
		return;
		}
	else
	if(senderRef == gold_switch)
		{
		SetWallCel(gold_switch, 1);
		SetTimer(1.0);
		PlaySoundPos(act_snd, GetSurfaceCenter(gold_switch), 1.0, -1, -1, 0x0);

		SetPlayerTeam(player, 2);

		// Give the player a gold costume
		SetThingModel(player, gold_mdl);

		AddDynamicTint(player, 0.0, 0.75, 0.0);
		StopThing(player);
		TeleportThing(player, gold_start);
		dummy = CreateThing(teleport_particles, player);
		PlaySoundThing(teleport_snd, player, 1.0, -1, -1, 0x80);

		// spawnpoints 8 to 15 are GOLD, so it is 0xFFFF00FF
		SetRespawnMask(player, 0xFFFF00FF);
		return;
		}
return;
#---------------------------------------------------------
timer:
	SetWallCel(gold_switch, 0);
return;
##########################################################
end

try it and see if its what you want.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited May 02, 2004).]
Famous last words - "It seemed like a good idea at the time."

↑ Up to the top!