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 → *hits cog* WORK!
*hits cog* WORK!
2000-11-11, 4:25 PM #1
Code:
symbols

thing        powerup                            local
thing        player                             local
int          bin=62                             local                         

flex         shield                             local                         
flex         damage                             local                         

sound        pickupsnd=helthpu1.wav             local                         
sound        outsnd=SCAlarm.wav                 local                         
sound        respawnsnd=Activate01.wav          local                         

material     mat0=invis.mat                     local                         

model        oldModel                           local                         
model        iModel=invis.3do                   local                         

message      touched                                                          
message      taken                                                            
message      damaged                                                          
message      respawn                                                          
message      newplayer                                                        

end                                                                           

# ========================================================================================

code

touched:
	MaterialAnim(mat0, 50, 1);
   player = GetSourceRef();
   oldModel = GetThingModel(player);
   powerup = GetSenderRef();
   TakeItem(powerup, player);

   Return;

# ........................................................................................

taken:
   player = GetSourceRef();
   powerup = GetSenderRef();
	shield = 200;
   Print("Invis-O-suit");

   // Do effects.
   PlaySoundThing(pickupsnd, powerup, 1.0, -1, -1, 0);
   AddDynamicTint(player, 0.0, 0.0, 0.2);

   // Make the player model to the "invis-o-mode" model.
   SetThingModel(player, iModel);

   SetInvActivated(player, bin, 1);

   // Effect lasts 30 seconds, expand if already on.

   Return;

# ........................................................................................

respawn:
   powerup = GetSenderRef();
   PlaySoundThing(respawnsnd, powerup, 0.6, 5.0, 10.0, 0);

   Return;

# ........................................................................................

newplayer:

   if(IsInvActivated(player, bin))
   {
      SetInv(player, bin, 1.0);
      SetInvActivated(player, bin, 0);
   }

   Return;

#..............

damaged:
	   damage = GetParam(0);
   if(shield > 0)
   {
         AddDynamicTint(player, 0, damage/100, damage/100);
         shield = shield - damage;
         if(shield < 0) {
            	damage = -shield;
		SetInv(player, bin, 1.0);
      		SetInvActivated(player, bin, 0);
		Print("Shield Suit has run out of energy");
      		PlaySoundLocal(outsnd, 1.0, 0.0, 0); }
         else {
            damage = 0;
		jkStringClear();
		jkStringConcatAsciiString("Your Shield Suit's energy level is at ");
		jkStringConcatFlex(shield);
		jkStringOutput();
		jkStringClear(); }
   }
   ReturnEx(damage);

return;

end


ok, it changes my model, but none of the damage reducing parts work...and it beeps like a regular supershield after a while(thats what it replaces) even though i didnt tell it to!

------------------
-GB
easy as linkid=1 linkid=2 linkid=3!

before you judge some one, walk a mile in their shoes, they you will be a mile away...and have their shoes.
I'm just an old man with a skooma problem.
2000-11-11, 5:25 PM #2
Looks like you forgot to define the player in the damage part. Try adding

Player = GetSenderRef();

or

if(GetSenderRef() != player) return;

That might help on that part.
"Be kind to nerds because one day... one will be your boss."
SavageX's Editing Corner
2000-11-11, 6:17 PM #3
well...it doesnt even seem to call the damaged message at all...ill try doing that from within the kyle.cog...
I'm just an old man with a skooma problem.
2000-11-12, 12:58 AM #4
Or, try masking the "player", like in darkjedi cogs.

------------------
http://millennium.massassi.net/ - Millennium
2000-11-12, 4:51 AM #5
well, it works now, and its really fun.
but only in LEC levels....

i tried it in morpheus and Empire night club, and my skin was kyle from the beginning(i had chosen Yun) and the model switching didn't work....
I'm just an old man with a skooma problem.

↑ Up to the top!