Code: Select all
(sysCreateShip "&scHornet;" gSource)
What I want to do is summon a hornet on top of the player, which is allied with the player.
Thanks
Code: Select all
(sysCreateShip "&scHornet;" gSource)
Code: Select all
<Events>
<OnGlobalPlayerEnteredSystem>
; Using gPlayerShip instead of gSource and vt064PirateOwnerBeacon instead of gItem
; based on what George said in a forum thread from 2014:
; "The main problem is that _OnGlobalSystemCreated_ is a "global" event, which means it runs outside of the context
; of any particular object. Specifically, gSource will be Nil when it runs."
(block Nil
; (objSendMessage gPlayerShip Nil "Player entered system!") USED FOR DEBUGGING PURPOSES
(if gunship256_readyForSolarOwnerAttack
(block Nil
(sysAddEncounterEventAtDist 120 gPlayerShip &etSolarOwnerAttack; 50)
(sysAddEncounterEventAtDist 300 gPlayerShip &scCorsairIIAttack; 50)
(objRemoveItem gPlayerShip (itmCreate &vt064PirateOwnerBeacon; 1))
(setq gunship256_readyForSolarOwnerAttack Nil)
)
)
)
</OnGlobalPlayerEnteredSystem>
</Events>
Code: Select all
<EncounterTable UNID="&scCorsairIIAttack;">
<Ship class="&scCorsair-II;" count="3" orders="attack" sovereign="&svPirates;"/>
</EncounterTable>
<EncounterTable UNID="&etSolarOwnerAttack;">
<Ship class="&scSolarOwner;" count="1" orders="attack" sovereign="&svPirates;"/>
</EncounterTable>
Great! I'd be interested in taking a look at the mod when you're finished to see how you solved the problem. Are the ships escorting your ship or just appearing and then defending themselves from hostiles?Peter wrote:Thanks for the help! I might do that if I run in to troubles, but Digdug helped me over on the IRC
Thanks anyway though!
I was mostly doing it out of curiosity, I didn't end making a mod out of it yet, but I might in future. Here is the code I used:Great! I'd be interested in taking a look at the mod when you're finished to see how you solved the problem. Are the ships escorting your ship or just appearing and then defending themselves from hostiles?
Code: Select all
(block (theSentinel)
(setq theSentinel (sysCreateShip &scIocrymSentinel; gSource &svFriendlyAuton;))
(shpOrder theSentinel 'escort gSource)
(shpOrderImmediate theSentinel 'attack (sysFindObject gSource "sEN"))))
Being a "Commonwealth Pilot" just means you haven't died enoughPeter wrote:Also I'm on 49 wiki posts so I'm just going to send this to see if I get upgraded to commonwealth pilot...
Yup it worked
Code: Select all
OnjSetProperty Nil
I don't think that code would work. Doesn't it have to bebtw, Re: your signature :
the "wall" only has the power you give it:
Code:
OnjSetProperty Nil
nothing will stand in your way of Greatness.
Code: Select all
ObjSetProperty
Thanks! Currently working on it pretty slowly as I just recently got both Corporate command and Eternity port, and am busy using most of my time playing through themI do hope your experiments work out well for you.