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 → Constant healing
Constant healing
2001-04-21, 3:08 PM #1
Anyone suggest where to go to learn how to make a cog (I think) that will make the player constantly being healed (a la a healing factor ish power) like in a healing sector?
- Ephraim "Danger Could Be My Middle Name If It Wasn't Already Todd" Ellis
C.E.O., Dark Riders Productions
http://www.TheStairwell.com
2001-04-21, 6:49 PM #2
Do you want the player to be constantly healed, no matter where he is?
Although I have no idea why you would want to be constantly healed (kinda defeats the purpose of getting damaged), here is a cog:


Code:
# Jedi Knight Cog Script
symbols

thing       player                           local

message     startup
message     pulse

end

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

code

startup:
   player = GetLocalPlayerThing();
   SetPulse(0.1);

   Return;

pulse:
   HealThing(player, 100);
   Return;

end


If you're trying to not get hurt, then you might as well turn invul on in the console ("jediwannabe 1" in jk, or "boinga 1" in mots)or do it with a cog via SetActorFlags(player, 0x8)

If I misintrepeted your post and you meant you wanted to be healed in a sector not
Quote:
<font face="Verdana, Arial" size="2">
like in a healing sector
</font>

(like meaning similar to) then you only need to slightly modify the code above:
Code:
# Jedi Knight Cog Script
symbols

thing       player      local             
sector      healsector

message     startup
message     entered
message     exit
message     pulse

end

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

code

startup:
   player = GetLocalPlayerThing();
   Return;

entered:
   SetPulse(0.1);
   Return;

exit:
   SetPulse(0);
   Return;

pulse:
   HealThing(player, 100);
   Return;

end


Hope this helps [http://forums.massassi.net/html/smile.gif]

-------
dBcLiCk (The Spaman)

2001-04-21, 6:57 PM #3
It's for a mod... and it's not fast healing, only 1 health point every 3 or 4 seconds. It's to simulate a highlander/immortal quick healing thing. If you've seen that movie...
- Ephraim "Danger Could Be My Middle Name If It Wasn't Already Todd" Ellis
C.E.O., Dark Riders Productions
http://www.TheStairwell.com
2001-04-21, 6:59 PM #4
Would that cog work in every level (i.e. for a mod, which would effect every level the player has), or would it only work if you implemented it in a specific level (like a door or elevator, etc.?)

[This message has been edited by Agent 121 (edited April 21, 2001).]
- Ephraim "Danger Could Be My Middle Name If It Wasn't Already Todd" Ellis
C.E.O., Dark Riders Productions
http://www.TheStairwell.com
2001-04-22, 3:53 AM #5
1 health point every 3 or 4 seconds is not fast healing...

Anyhow, here's dbclick's first posted cog only modified for the slower healing:

Code:
# Jedi Knight Cog Script
symbols

thing       player         local
message     startup
message     pulse

end
# ==================================

code

startup:   
     player = GetLocalPlayerThing();
     SetPulse(3);   
     Return;

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

pulse:   
     HealThing(player, 1);   
     Return;

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

end


[This message has been edited by Zecks (edited April 22, 2001).]
2001-04-22, 7:23 AM #6
still... would this cog make the effect by just gobbing it and putting it in a cog directory, or is it something ou'd have to implement in a level to make it work?
- Ephraim "Danger Could Be My Middle Name If It Wasn't Already Todd" Ellis
C.E.O., Dark Riders Productions
http://www.TheStairwell.com
2001-04-22, 10:07 AM #7
u probably want to whip a hotkey up for it. CHeck out the tutorial on Millenium for hotkeys, there is one on massassi too.
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-04-23, 11:01 AM #8
If you want to implement it in every level, then try this relatively easy way.
save the code below as force_well.cog

Code:
# Jedi Knight Cog Script
#
# FORCE_WELL.COG
#
# This will heal the player in addition to giving force
#  
#

symbols

thing       player                           local

message     startup
message     pulse

int	    healtime=1			local
int	    timetoheal=4

end

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

code

startup:
   player = GetLocalPlayerThing();
   Sleep(1.0);
   SetPulse(1.0);

   Return;

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

pulse:
   // don't do anything if the player is currently dead
   if(GetThingHealth(player) < 1) Return;

   ChangeInv(player, 14, GetInv(player, 20) / 2);

   if(GetInv(player, 14) > GetInv(player, 20) * 50)
      SetInv(player, 14, GetInv(player, 20) * 50);

   if (healtime !=timetoheal)
   {
	healtime = healtime + 1;
   }
   else
   {
	HealThing(player, 1);
	healtime = 1;
   }


   Return;

end


Put it in your project directory and GOB the project. When your mod is active, jk will use this cog in any level. (It replaces the cog that recharges your force)

Note: to change the time between heals, just alter timetoheal in the Placed Cog window in JED. [http://forums.massassi.net/html/wink.gif]
--------
dBcLiCk (The Spaman)

↑ Up to the top!