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 → damage from fallling on a water surface
damage from fallling on a water surface
2001-04-07, 1:28 PM #1
this is actually a continuation of a previous post on surface damage. i gather from the lack of replies that everybody thought i was talking about a solid surface, which is pretty easy to do with a cog. what i want to do is have a passable surface cause as much (or slightly less) damage as a solid surface when fallen upon. i want to make the surface of the water in my level cause damage when you fall into it from up high but less damage if the falling distance is shorter. if the distance is short then no damage would be caused. it would be just like the floor but you would pass through it as you take the damage. any ideas? i'm pretty new to cogging. i've modified a few cogs but haven't made any of my own from scratch.

------------------
"the mouse is my chisel."
Little House of Hazards
Surface Disposal Outpost
"the mouse is my chisel."
MotS mp:
Little House of Hazards
Surface Disposal Outpost
2001-04-07, 1:40 PM #2
one idea i had was to make the surface always impassable, then change the surface to passable like .0001 seconds after it's walked apon, then immediately swithching it back to impassable. then you would hit the surface but immeditately drop through. i would just have to figure out a cog to do that....
"the mouse is my chisel."
MotS mp:
Little House of Hazards
Surface Disposal Outpost
2001-04-10, 4:46 AM #3
now, i'm sure somebody can help me out
"the mouse is my chisel."
MotS mp:
Little House of Hazards
Surface Disposal Outpost
2001-04-10, 5:18 AM #4
I have an idea but not sure if it's possible. Something like:

Code:
splash:
speed = GetThingVel(player);
fall = VectorZ(speed);
if(fall <= -1)
{
DamageThing(player, 1000, 0x20, player);
}
Return;


what I'm trying to do is take a speed measurement at the time player makes a splash. Not sure that it works though. I'm guessing that -1 in the if() would need tweaking. Also the water might slow the player too quickly making it impossibleto determin a speed difference from falling into water or entering it normally. Dont know.
- Wisdom is 99% experience, 1% knowledge. -
2001-04-10, 6:28 AM #5
Well, it depends, really, on whether you have a sector above it, but this may work (SP Only, I'm afraid, but it could be converted):
Code:
# WaterPain.cog
#
# A cog to check the height of the player, and do damage depending
#
# 2001 LordVirus
#
# This COG is not supported by LucasArts Entertainment Co.
#
symbols

sector     fallsector
sector     watersector
thing      player         local
thing      ghost          local
template   ghostobj=ghost local

message    startup
message    entered

#--------------------------------------------
code

startup:

player=GetLocalPlayerThing();
return;
#--------------------------------------------
entered:

if (GetSenderRef()==fallsector){
ghost=CreateThing(ghostobj, player);
}
else
if (GetSenderRef()==watersector){
DamageThing(player, 10*(VectorDist(GetThingPos(ghost), GetThingPos(player))*2)));
}
return;

end


Feel free to use/modify this cog, but please give me credit for it if you do.

------------------
LordVirus: His pot is blacker than his kettle!

Visit Virus Productions!
"And lo, let us open up into the holy book of Proxy2..." -genk
His pot is blacker than his kettle!
2001-04-11, 1:24 PM #6
well, thanks. i think that gave me a push in the right direction. i think i need to know more about cog, though.
"the mouse is my chisel."
MotS mp:
Little House of Hazards
Surface Disposal Outpost

↑ Up to the top!