Eoc modding newbie question
18 years 11 months ago #14449
by Cormorant
Replied by Cormorant on topic Eoc modding newbie question
Yepp, POG is indeed getting much easier once you got your first script running 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?
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.
18 years 11 months ago #14450
by MajorTom
Replied by MajorTom on topic Eoc modding newbie question
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
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.
18 years 11 months ago #14459
by Cormorant
Replied by Cormorant on topic Eoc modding newbie question
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?
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.
- GrandpaTrout
- Offline
- King of Space
18 years 11 months ago #14464
by GrandpaTrout
Replied by GrandpaTrout on topic Eoc modding newbie question
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.
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.
18 years 11 months ago #14474
by Cormorant
Replied by Cormorant on topic Eoc modding newbie question
More thanks That really helped to figure it out.
Please Log in or Create an account to join the conversation.