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 → Item Surface Switch Switch
Item Surface Switch Switch
2004-04-28, 2:26 PM #1
lol.
i need someone to right me up a quick cog that allows you to put ghost positions in the level, and when u assign the ghosts with the cog, they will change gun 3do when a surface is activated... you can go off the rules a little bit, and perhaps make one switch or 3 or more, you pick. I just need it to switch from Concussion Rifles, to Rail Dets, or partially inbetween if i duplicate the cog in placed cogs and resassign diferent ghost positions. (sorry if im thinking outloud). have it so concs are the weapon when you start the level, and have this work for multiplayer. if this is possible it would be nice, if you dont have a lot of time on your hands, assign me a beta that i will test and inform you with the details. I will CreDiT you! Thx for you time!

------------------
Your Owners Clan Leaader,
_yo_wasup_

[This message has been edited by YourOwners (edited April 28, 2004).]
-=__/¯¯l¤¥Ø¤l¯¯\__\/\/ª≤uÞ_=-
http://www.TeamYo.org
2004-04-28, 5:58 PM #2
this one may work for you.
Code:
##########################################################
# Jedi Knight Cog Script  (JK)
#---------------------------------------------------------
# POWERUPSWITCH01.COG
#---------------------------------------------------------
# Written By DSLS_DeathSythe
# This COG is NOT supported by LucasArts Entertainment Co.
##########################################################
symbols
#---------------------------------------------------------
message     startup
message     activated
#--------------------#
thing       ghost_pos=-1
surface     switch=-1
sound       act_snd
template    powerup01_tpl
template    powerup02_tpl
#--------------------#
thing       powerup_thng=-1                               local
int         status=0                                      local
#---------------------------------------------------------
end
#=========================================================
code
#---------------------------------------------------------
startup:
	if(!IsServer()) return;
	powerup_thng = CreateThing(powerup01_tpl, ghost_pos);
	status = 0;
return;
#---------------------------------------------------------
activated:
	if(GetSenderRef() != switch) return;

	if(status == 0)
		{
		status = 1;
		SetWallCel(switch, 1);
		PlaySoundPos(act_snd, GetSurfaceCenter(switch), 1.0, -1, -1, 0x0);
		if(powerup_thng != -1)
			{
			DestroyThing(powerup_thng);
			powerup_thng = -1;
			}
		powerup_thng = CreateThing(powerup02_tpl, ghost_pos);
		return;
		}
	else
		{
		status = 0;
		SetWallCel(switch, 0);
		PlaySoundPos(act_snd, GetSurfaceCenter(switch), 1.0, -1, -1, 0x0);
		if(powerup_thng != -1)
			{
			DestroyThing(powerup_thng);
			powerup_thng = -1;
			}
		powerup_thng = CreateThing(powerup01_tpl, ghost_pos);
		return;
		}
return;
##########################################################
end

try it, see if its what you need.
tell me if you need any changes.

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."
2004-04-29, 6:53 PM #3
thx, ill test tomorrow, *yawn time for bed.
ill tell you the details soon. [http://forums.massassi.net/html/wink.gif]

------------------
Your Owners Clan Leaader,
_yo_wasup_
-=__/¯¯l¤¥Ø¤l¯¯\__\/\/ª≤uÞ_=-
http://www.TeamYo.org
2004-05-07, 7:28 PM #4
DeathSythe, i just tested the cog and nothing happens when i activate the surface, i set up everything correctly, but when i tested, i didn't even hear a sound when i activated the surface.

while your editing this, make sure that both the host and joiners can hear it saying the sound throughout the whole level. Thanks a lot!

------------------
Your Owners Clan Leaader,
_yo_wasup_
-=__/¯¯l¤¥Ø¤l¯¯\__\/\/ª≤uÞ_=-
http://www.TeamYo.org
2004-05-08, 7:28 PM #5
the cog works fine when i test it in MP.
is the item there when the level starts? if its not then the cog probably isnt being loaded or somthing.
i dont know what to do about that.

as for the sound playing all over the level replace both of these lines:
Code:
PlaySoundPos(act_snd, GetSurfaceCenter(switch), 1.0, -1, -1, 0x0);

with...
Code:
PlaySoundGlobal(act_snd, 1.0, 0.0, 0x0);
that will make the sound play all over the level.

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

↑ Up to the top!