Need a bit of event scripting help

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
stylesrj
Posts: 3644
Joined: Tue Jul 08, 2014 7:54 am

Need a bit of event scripting help

Postby stylesrj » Sun Sep 14, 2014 6:24 am

I'm working on an automated Zoltan ship and I need to make an event that spawns in about 4 (or just 2) Zoltans but only at the start beacon. I've been trying to get it to work for about an hour but for some reason, it only allows one Zoltan to come onboard.

If I don't allow a Zoltan to come onboard, it loads up a random event from somewhere or crashes the game.

Here's the code I've got:

Code: Select all

<event name="START_BEACON">
   <text>Welcome to a new sector! Get to the exit beacon and jump to the next sector before the pursuing Rebels catch you!</text>
   <choice hidden="true">
      <text>Continue...</text>
      <event/>
   </choice>
   <choice req="ZOLTANCREW" hidden="true">
      <text>Request some Zoltans from the ZRPC</text>
      <event load="ZOLTAN_CREW_ARRIVAL"/>
   </choice>
</event>

<eventList name="ZOLTAN_CREW_ARRIVAL">
   <event>
      <text>The ZRPC acknowledges your request. There's a shortage of staff so they can only spare the one Zoltan.</text>
      <crewMember amount="1" class="energy">
         <choice>
         <text>Continue</text>
            <event>
            <text>The Order of the Great Eye steps in and delivers one of their monks to reinforce them.</text>
            <crewMember amount="1" class="energy" all_skills="1">Bond-Monk</crewMember>
            </event>
         </choice>
   </event>
</eventlist>


ZOLTANCREW is a dummy augment I created so you can't just grab 4 Zoltans on any ship, it has to be that particular ship.

What am I doing wrong?
User avatar
stylesrj
Posts: 3644
Joined: Tue Jul 08, 2014 7:54 am

Solution discovered

Postby stylesrj » Sun Sep 14, 2014 7:23 am

Never mind. I got it somewhat working.

Code: Select all

    <event name="START_BEACON">
       <text>Welcome to a new sector! Get to the exit beacon and jump to the next sector before the pursuing Rebels catch you!</text>
       <choice hidden="true">
          <text>Continue...</text>
          <event/>
       </choice>
       <choice req="ZOLTANCREW" hidden="true">
          <text>Request some Zoltans from the ZRPC</text>
          <event load="ZOLTAN_CREW_ARRIVAL"/>
       </choice>
    </event>

    <eventList name="ZOLTAN_CREW_ARRIVAL">
       <event>
          <text>The ZRPC acknowledges your request but say there's a shortage of staff so they can only spare the one Zoltan.</text>
         <crewMember amount="1" class="energy" />
             <choice>
                <text>Continue</text>
               <event>
                  <text>The Order of the Great Eye steps in and delivers one of their monks.</text>
                  <crewMember amount="1" class="energy" all_skills="1">Elizabeth-Trikko</crewMember>
                  <choice>
                  <text>Continue</text>
                  <event>
                  <text>An acolyte steps in to serve.</text>
                  <crewMember amount="1" class="energy" />
                     <choice>
                     <text>Continue</text>
                     <event>
                     <text>And another one also agrees to join</text>
                     <crewMember amount="1" class="energy" />
                     </event>
                     </choice>
                  </event>
                  </choice>
               </event>
             </choice>
       </event>
    </eventList>
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: Need a bit of event scripting help

Postby kartoFlane » Sun Sep 14, 2014 1:54 pm

Some time ago I've written a small framework mod that serves to simplify this -- Universal Starting Beacon. For an example of how to use this, you could check out my Auto-Cruiser ship.
Superluminal2 - a ship editor for FTL
User avatar
stylesrj
Posts: 3644
Joined: Tue Jul 08, 2014 7:54 am

Re: Need a bit of event scripting help

Postby stylesrj » Sun Sep 14, 2014 7:21 pm

Some time ago I've written a small framework mod that serves to simplify this -- Universal Starting Beacon. For an example of how to use this, you could check out my Auto-Cruiser ship.


I remembered there was a mod which did it, but I forgot about it and tried using what was done on the Flagship Randomiser, combined with that Zoltan Monastery event in CE.

Did the Flagship Randomiser use USB?
User avatar
RAD-82
Posts: 796
Joined: Sat Nov 09, 2013 12:16 am

Re: Need a bit of event scripting help

Postby RAD-82 » Sun Sep 14, 2014 7:26 pm

stylesrj wrote:What am I doing wrong?


Even though you already fixed this, I'll point out the problem for other people to see.

Code: Select all

      <text>The ZRPC acknowledges your request. There's a shortage of staff so they can only spare the one Zoltan.</text>
      <crewMember amount="1" class="energy">
         <choice>
         <text>Continue</text>


You forgot to close the crewMember tag.
Image
Junkyard has FTL mods, mostly ships and a few other things.