I'm setting up missions for Hell's Trinity and recently made a breakthrough using old Commonwealth Habitat Mission coding from Eridani.xml. After some hair-pulling I managed to get it working - the game chooses a random Ares station and tells the player to go kill out and destroy it -- only trouble is, it oftetimes chooses an already destroyed station.
I have gone through the Wiki and there are no Object paramteres for "not destroyed". So what are my options? How do I filter out stations that aren't destroyed?
I'm not entirely sure but isn't there a criteria that is "active"? If so, that would mean that it only finds active things, like ships or live stations. It might ignore stations.
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
Drako Slyith wrote:I'm not entirely sure but isn't there a criteria that is "active"? If so, that would mean that it only finds active things, like ships or live stations. It might ignore stations.
I'm using "A"...I don't think that's working. "N" is just for nearest, but I'll remove that and try again. Do you want to see all the coding for the mission?
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
<HelpLevel1>
<OnPaneInit>
(block Nil
; Construct a list of all enemy stations within a certain radius
(setq enemyStations (sysFindObject gSource "tAN +HellAresOutpost;"))
(switch
; If there are no valid missions available, then nothing
(not enemyStations)
(scrShowPane gScreen "AllGood")
; Give out a mission
(block (target)
(setq target (seededRandom (objGetDestiny gSource) enemyStations))
(objSetObjRefData gSource "target" target)
; Remember the nature of the target
(switch
(objHasAttribute target "HellAresOutpost")
(objSetData gSource "missionID" 'aresOutpost)
)
)
)
(setq missionID (objGetData gSource "missionID"))
(setq gTarget (objGetObjRefData gSource "target"))
; Compute reward
(setq gReward (add 500 (multiply (objGetLevel gTarget) 100)))
; Compose message
(scrSetDesc gScreen(cat
"\"One, ey?. Well, better than nothing. I want you to go and do the same again - go take down this Outpost for me."
"If you succeed I'll pay you " gReward " credits. Can you do that?\""
))
)
</OnPaneInit>
<Actions>
<Action name="Accept" key="A" default="1">
(block (targetCount totalMissionCount)
; Target
(objRegisterForEvents gSource gTarget)
; Order the player
(shpCancelOrders gPlayerShip)
(shpOrder gPlayerShip 'attack gTarget)
; Set mission status
(objSetData gSource "missionStatus" 'inProgress)
(objSetGlobalData gSource "missionInProgress" True)
(objSetData gSource "missionFee" gReward)
; Keep track of total mission count
(setq totalMissionCount (objGetGlobalData gSource "totalMissionCount"))
(if (not totalMissionCount) (setq totalMissionCount 0))
(objSetGlobalData gSource "totalMissionCount" (add totalMissionCount 1))
(scrShowPane gScreen "MissionAccept")
)
</Action>
<Action name="Decline" key="D" cancel="1">
(scrShowPane gScreen "Refuse")
</Action>
</Actions>
</HelpLevel1>
<MissionAccept>
<OnPaneInit>
(scrSetDesc gScreen
"\"Good, soldier! I'lll program the target into your ship's computer. Just follow the arrow on your screen and go give those Ares Hell! Good luck!\""
)
</OnPaneInit>
<Actions>
<Action name="Continue" key="C" default="1" cancel="1">
<Exit/>
</Action>
</Actions>
</MissionAccept>
<MissionSuccess>
<OnPaneInit>
(block (desc fee missionID)
(setq missionID (objGetData gSource "missionID"))
(objSetData gSource "missionStatus" Nil)
(objSetGlobalData gSource "missionInProgress" Nil)
(shpCancelOrders gPlayerShip)
(setq fee (objGetData gSource "missionFee"))
(intMissionRewardPayment fee)
(switch
(eq missionID 'aresOutpost)
(setq desc (cat
"\"Great work! Every blow against the Ares helps!"
))
)
(scrSetDesc gScreen (cat
desc
" Here, I've deposited " fee " credits to your account.\""
))
)
</OnPaneInit>
<Actions>
<Action name="Continue" key="C" default="1" cancel="1">
(scrShowPane gScreen "Default")
</Action>
</Actions>
</MissionSuccess>
<!-- Mission is going on-->
<MissionInProgress>
<OnPaneInit>
(block (missionID)
(setq missionID (objGetData gSource "missionID"))
(switch
(eq missionID 'aresOutpost)
(scrSetDesc gScreen
"\"What's wrong? Are you going to kick those Ares's ass, or are they too tough for you? Get back out there and finish the job!\""
)
(scrSetDesc gScreen
"\"What's wrong? You said you could handle this mission! Get back out there and finish the job!\""
)
)
)
</OnPaneInit>
<Actions>
<Action name="Continue" key="C" default="1" cancel="1">
(block Nil
(shpCancelOrders gPlayerShip)
(shpOrder gPlayerShip 'dock (objGetObjRefData gSource "target"))
(scrExitDock gScreen)
)
</Action>
</Actions>
</MissionInProgress>
Here ya go. No doubt it's riddled with bugs... >.>
are we being nice to the ares now O.o
why not use 'attack ?
-----------
apart from that it looks good
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
Another problem -- even when I do get sent to a real Ares Outpost, the game doesn't realise when it has been destroyed...it just keeps pointing to the outpost...
Can anyone see in the coding there why that wouldn't happen?
Because you're telling the player to dock with it? You can dock with a dead station. You can't kill a dead station. That may be it. Also, I once built a mission, and it didn't recognize I had done it until I copied some effect data from a CSC telling itself when the mission was over. That could be your problem.
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"