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 → I need some help
I need some help
2001-08-25, 3:21 PM #1
I want to make a cog that checks what health you are on, say 50, and then change the 3d0 model. The idea came to me when thinking it would be quite good to have wounded Kyle's all runnin about the place with bandages on there heads. Is it possible to do this if so can somebody help me to do it.

------------------
'The God of Death is Back from Hell' - Duo Maxwell
'I'll Kill Zechs, that will be my way of saying thanks' - Heero Yuy
'You can try and kill me, but I might struggle a bit' - Trowa Barton
2001-08-26, 2:52 AM #2
Define two templates, one with the healthy 3do and one with the wounded.

Then either use the damaged: message to check if health drops below 50 or do a regular pulse and inside the pulse do an if-condition with GetThingHealth(player) <=50 , and then change the 3do of the player (I believe the verb's called SetModel(thing, model)).

Hope that helps,
-Raze
--
You are all just jealous because you can't hear the small voices!!
2001-08-26, 6:27 AM #3
There you go, I wrote it a long time ago for someone else who requested the very same thing. You'll want to replace iky.3do with your injured player model. To see how it works download the injury mod from this page: http://24.150.160.206/aggya/downloads.html
Code:
#============================================================
# damagep.cog
# changes the players model depending on what their health is
# Not supported by LucasArts because they suck
# (C) Jay Inc. 01\13\01
# -Aglar
#============================================================
symbols
message startup
message pulse
model damaged=iky.3do
model healthy=ky.3do
end
#============================================================
code
startup:
SetPulse(0.1);
Return;
#============================================================
pulse:
player = GetSourceRef();
health = GetThingHealth(player);
if (health <= 50)
{
	SetThingModel(player, damaged);
}
else
{
	if (health >= 50)
	{
		SetThingModel(player, healthy);
	}
}

Return;
#============================================================
end
2001-08-26, 2:08 PM #4
Less cpu usage here. Add it in the damaged message section of the kyle.cog right after where it says ReturnEx(damage);

Code:
   if(GetThingHealth(player) >= 50) SetThingModel(player, healthyKyle);
   else SetThingModel(player, notSoHealthyKyle);


------------------
http://millennium.massassi.net/ - Millennium
2001-08-26, 4:58 PM #5
Yeah, that was the stipulation I was given: it had to be a standalone cog.
2001-08-27, 12:49 AM #6
Alright.

Code:
symbols

thing player local


message startup
message damaged


end


code


startup:


   CaptureThing(GetLocalPlayerThing());


return;


damaged:

   player = GetLocalPlayerThing();


   if(GetSourceRef() != player) return; 


   if(GetThingHealth(player) >= 50) SetThingModel(player, healthyKyle);
   else SetThingModel(player, notSoHealthyKyle);


   return;


end


Again, less cpu usage version [http://forums.massassi.net/html/smile.gif]

------------------
http://millennium.massassi.net/ - Millennium
2001-08-27, 3:59 AM #7
would be even less cpu usage if you put the player = GetLocalPlayerThing(); in the startup section...

-Raze
--
You are all just jealous because you can't hear the small voices!!
2001-08-27, 6:14 AM #8
Grrr [http://forums.massassi.net/html/smile.gif]
Come on, it was the first cog I ever wrote for someone [http://forums.massassi.net/html/smile.gif]
Code:
symbols

thing player local


message startup
message damaged

model healthyKyle
model notSoHealthyKyle=kyh4.3do

end


code


startup:

   healthyKyle=GetThingModel(player);
   CaptureThing(GetLocalPlayerThing());


return;


damaged:

   player = GetLocalPlayerThing();


   if(GetSourceRef() != player) return; 


   if(GetThingHealth(player) >= 50) SetThingModel(player, healthyKyle);
   else SetThingModel(player, notSoHealthyKyle);


   return;


end

This way when the player isn't hurt he doesn't automaticly become kyle, he's becomes whatever skin he chose originaly. I made the damaged kyle hyh4.3do, just so you can see the change, replace that with whatever your injured kyle model is.
2001-08-27, 8:08 AM #9
Excellent [http://forums.massassi.net/html/smile.gif]
I hope he got enough answer from us.

------------------
http://millennium.massassi.net/ - Millennium
2001-08-27, 8:47 AM #10
[http://forums.massassi.net/html/biggrin.gif]

↑ Up to the top!