Swimming

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
Masta_J
Posts: 37
Joined: Tue Apr 17, 2007 1:35 pm
Location: Johannesburg South Africa

Swimming

Post 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?
A good warrior knows his limits, but a great warrior finds his way around them.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Swimming

Post 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...
Everyone can see the difficult, but only the wise can see the simple.
-----
Masta_J
Posts: 37
Joined: Tue Apr 17, 2007 1:35 pm
Location: Johannesburg South Africa

Re: Swimming

Post 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?
A good warrior knows his limits, but a great warrior finds his way around them.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Swimming

Post 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.
Pain is only psychological.
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: Swimming

Post 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)
Masta_J
Posts: 37
Joined: Tue Apr 17, 2007 1:35 pm
Location: Johannesburg South Africa

Re: Swimming

Post 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...
A good warrior knows his limits, but a great warrior finds his way around them.
Post Reply