Greetings. I'm currently developing an advanced Bacta Tank COG for my new level. First, I will explain what the COG's supposed to do.
Basically, the water filling up/emptying works by moving a flat water textured 3DO, and then changing the empty sector into water. (As seen in Nebula's level "Deep" (the air lock doors))
Here is an ugly image of the Bacta Tank:
![http://img298.imageshack.us/img298/4620/bacta4cs.jpg [http://img298.imageshack.us/img298/4620/bacta4cs.jpg]](http://img298.imageshack.us/img298/4620/bacta4cs.jpg)
Now, here is the COG I wrote. It justs moves the Water 3DO and gives Healing+Mana. I still have to figure out how to change the Bacta Tank sector into water.
Here are the two issues I get:
That's all for now. I'll have to figure out also how to change the empty Bacta Tank into a Water Sector.
Thanks.
- Two switches (one inside the bacta tank and one outside) enable to fill up/empty the water from the bacta tank
- When in the water, player receives healing
Basically, the water filling up/emptying works by moving a flat water textured 3DO, and then changing the empty sector into water. (As seen in Nebula's level "Deep" (the air lock doors))
Here is an ugly image of the Bacta Tank:
![http://img298.imageshack.us/img298/4620/bacta4cs.jpg [http://img298.imageshack.us/img298/4620/bacta4cs.jpg]](http://img298.imageshack.us/img298/4620/bacta4cs.jpg)
Now, here is the COG I wrote. It justs moves the Water 3DO and gives Healing+Mana. I still have to figure out how to change the Bacta Tank sector into water.
Code:
# Jedi Knight Cog Script
#
# bacta_tank.cog
#
# This script controls a bacta tank. Two switches (one inside the bacta tank and one outside) enable
# to fill up/empty the water from the bacta tank. When in the water, player receives healing.
#
# [Dominik]
#
# ========================================================================================
flags=0x40
symbols
message activate
message arrived
message pulse
surface call0 linkid=1
surface call1 linkid=1
surface call2 linkid=1
surface call3 linkid=1
thing water desc=water_object
sector tank
int curframe=0 Local
flex start_wait=0.25 desc=pause_before_moving_up
flex speed=4.0
sound wav0=lvrclik1.wav # Switch sound
thing powerup local
thing player local
int bin=14 local
flex healInterval=1.0 # Time interval (in seconds) between healing pulses
flex heal=5.0 # Health gained per pulse
sound wav1=forcehealing01.wav # Heal sound
thing victim local # Player or actor that's healing
int type local
int mana=25.0 # Mana added per pulse
end
# ========================================================================================
code
activate: // If player presses button
if (GetWallCel(call0) == 1) return;
if (GetSenderId() != 1) return;
setwallcel(call0,1);
setwallcel(call1,1);
setwallcel(call2,1);
setwallcel(call3,1);
PlaySoundPos(wav0, SurfaceCenter(GetSenderRef()), 1, -1, -1, 0);
curframe=getcurframe(water);
movetoframe(water, 1-curframe, speed);
if (curframe == 1);
{
if(tank > -1) SetPulse(healInterval);
return;
}
stop;
# ........................................................................................
arrived:
setwallcel(call0,0);
setwallcel(call1,0);
setwallcel(call2,0);
setwallcel(call3,0);
PlaySoundPos(wav0, SurfaceCenter(GetSenderRef()), 1, -1, -1, 0);
stop;
# ........................................................................................
pulse:
victim = FirstThingInSector(tank);
while (victim != -1)
{
type = GetThingType(victim);
// If we have an actor (2) or a player (10)
if ((type==2) || (type==10))
// Heal and add Mana
{
HealThing(victim, heal);
ChangeInv(player, 14, mana);
PlaySoundPos(wav1, tank, 1, -1, -1, 0);
}
victim = NextThingInSector(victim);
}
return;
# ........................................................................................
end
Here are the two issues I get:
- When I press a switch, the Bacta Tank fills up (Water 3DO goes up) and when I go into the Bacta Tank, I get Healing. The problem's that when the Water 3DO is down (Bacta Tank's empty) and I go into the Bacta Tank, I still get Healing)
- The Healing sound doesn't work.
That's all for now. I'll have to figure out also how to change the empty Bacta Tank into a Water Sector.
Thanks.
Skateboarding is not a crime.
The timing is not right though. The sector changes to normal (no water), and the Water 3DO is still going down. Shall I change that with Sleep()?