Eoc modding newbie question

More
18 years 4 months ago #14449 by Cormorant
Yepp, POG is indeed getting much easier once you got your first script running :D Again, thanks to all of you who helped getting me started.

However, I've got a little question I couldn't find a solution for:
Is there a way to have the script check if a specific ship has been disrupted by a disruptor weapon?

Please Log in or Create an account to join the conversation.

More
18 years 4 months ago #14450 by MajorTom
Hi Comorant, here you go, Straight from the pog SDK:

prototype bool iShip.IsDisrupted( hship ship );
Parameters:
ship : A handle to a ship.
Return value:
TRUE if the ship is disrupted, FALSE otherwise.

The problem is probably more getting the handle to the ship, unless perhaps you're only interested in the player ship. For example:

if(!iShip.IsDisrupted(iShip.FindPlayerShip()))
{
<do stuff>
}


Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.

More
18 years 4 months ago #14459 by Cormorant
Thanks again!

However, I've noticed another thing that is obviously handled rather complicated (surprise ;) ): Returning a vessel's current damage.
I'd like to check if a given ship has already taken a certain amount of damage, but I haven't found a comprehensive example yet. One of the PS scripts seems to be dealing with damage to a given sim (a reactor), but I'm not too sure if this is what I'm looking for.
Just to make sure, there is no easy one-liner returning the damage of a sim at a certain point in the script, right?

Please Log in or Create an account to join the conversation.

More
18 years 4 months ago #14464 by GrandpaTrout
Yeah, nothing straight forward. Lucky for us the hit_points are accessable as an object property.

hit_points = Object.FloatProperty(ship,"hit_points");

There are some property names hiding in the package descriptions. Check out Sim and iSim. Read iSim carefully, it has a wealth of useful functions and properties.

Please Log in or Create an account to join the conversation.

More
18 years 4 months ago #14474 by Cormorant
More thanks :D That really helped to figure it out.

Please Log in or Create an account to join the conversation.