Page 1 of 1

Swimming

Posted: Tue Oct 28, 2008 2:03 pm
by Masta_J
Hi Guys. Two questions...

a) Is there any way, to turn a world model, or level geometry into an entity with an entityname. I want my scripted player to go into the "swim" order when he collides with my water model using the GetFastDistance command. So far I have used a trigger entity and the GetEventState command (which works fine), but the problem is when enemy pawns make contact with the water, they set the trigger off and my player pawn begins to swim on dry land.

b) Why does the wavy effect not work on world models with a Liquid entity attached to them. Is there a way around this?

Re: Swimming

Posted: Sun Nov 02, 2008 12:12 pm
by Jay
I am not sure if it has been implemented into the 'official build' but in my community releases i have implemented a command IsInLiquid() that checks if the pawn is inside a Liquid world model (i mean a model that has been assigned to the Liquid entity) and if yes, it returns the entity name of that Liquid entity... This is exactly for thinghs like that...

Re: Swimming

Posted: Mon Nov 03, 2008 3:12 pm
by Masta_J
Thanks Jay. I used this command in my script in RF 076. It doesn't crash or return any errors, but it doesn't have any effect... here is how I have written it:

if(IsInLiquid())
{
AnimateBlend(SWIMIDLE,0.1);
self.think="Swim";
}
}]

}

Any suggestions?

Does anyone know if rf076 supports this script command?

Re: Swimming

Posted: Mon Nov 03, 2008 3:24 pm
by Juutis
Masta_J wrote:Does anyone know if rf076 supports this script command?
Yes, it supports.

Posting the whole script, or perhaps the main parts that deal with swimming would help in finding the problem.

***EDIT***
You can use 'debug(IsInLiquid());' to see if the pawn is considered to be in liquid or not.

Re: Swimming

Posted: Mon Nov 03, 2008 3:40 pm
by QuestOfDreams
bool IsInLiquid();
Tests if the Pawn is inside a Liquid Entity.

string GetLiquid();
Returns the name of the Liquid Entity the Pawn is in. Returns an empty string ("") if the Pawn is not inside a Liquid
It's easy.
All you need is the manual, all you need is the manual,
All you need is the manual, the manual, the manual is all you need.
The manual, manual, manual, manual, manual, manual, manual, manual, manual.
All you need is the manual, all you need is the manual,
All you need is the manual, the manual, the manual is all you need.
(freely adapted from All you need is love :P)

Re: Swimming

Posted: Mon Nov 03, 2008 3:52 pm
by Masta_J
Thanks guys! IsInLiquid() works perfectly. I actually assigned my Liquid entity to the wrong world model is why I couldn't get it to work in the first place :|

Does anyone know the answer to my second question? Why does the wavy effect in the Brush attributes tab not take effect on world models with a Liquid entity assigned to them? My aim is to make a model that has the Liquid and Echaos entities attached with the brush attributes wavy effect...