Sign up Calendar Latest Topics

  Author   Comment  

Posts: 198
Reply with quote  #1 
For the LARP I'm writing, I plan to allow the players to repair a Command Base that has been damaged, bringing the beam weapon and torpedo launcher back online.  To simulate this I was planning on creating four copies of the same station:
1) Neither beam, nor torpedo
2) Beam working, not torpedo
3) Beam not work, torpedo is
4) Both beam and torpedo working

Then as the GM monitors the live escape-room-type challenges and sees (for example) that they have repaired the beam weapon, they can change the station from version 1 to version 2, etc.

My question to the sages is: can you directly convert a vessel type, or do I have to destroy the old version and create the new version?  At this stage, I'm just planning on it being a standard NPC base (not a player "ship"), so that simplifies things.  If I have to destroy/create then I imagine it will reset the shields to max value.  Can I use a copy_object_property to record the old shield value to a temporary mesh, destroy old version, create new version, copy_object_property to new version, then destroy temporary mesh?  Are there any other properties that I should retain?

Later, once everything is repaired, the engineers on the station can decide to strategically allocate their extra energy between a supercharged beam, faster reloading launcher, or increased manufacturing speed, using the same mechanic.  The goal is to give them interesting choices that affect the battle (without requiring another 6 laptops).
Dave Thaler

Posts: 503
Reply with quote  #2 
At Norwescon last year I ran a scripted mission that allowed upgrading a base from one type to another.  To change the type, I had to do this:
  • Rename the original to a temporary name so it won't collide with the new base
  • Create the new base with the original name
  • Use copy_object_property to copy all the properties you want to preserve
  • Destroy the original base

Posts: 198
Reply with quote  #3 
That is more elegant than what I had sketched out.  Did you just create the new base on top of the old one for that brief moment?  Thanks for sharing.
Dave Thaler

Posts: 503
Reply with quote  #4 
Originally Posted by HaydenBarca
That is more elegant than what I had sketched out.  Did you just create the new base on top of the old one for that brief moment?  Thanks for sharing.

I checked my script and I did it slightly more complicated than that.   I created a temporary base that was where it wouldn't collide with anything, copied the stats, deleted the original, created the final one, copied the stats, and deleted the temporary one.  I think that's because I couldn't find a way to rename a base.

Here's the relevant snippet I used in my script:

    <!--Rename DS1 so we can replace it-->
    <create type="station" x="0.0" y="0.0" z="0.0" angle="0" name="DS1Copy" raceKeys="friendly" hullKeys="Deep Space Base base" />
    <copy_object_property property="shieldState" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="canBuild" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="missileStoresHoming" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="missileStoresNuke" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="missileStoresMine" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="missileStoresEMP" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="missileStoresPShock" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="missileStoresBeacon" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="missileStoresProbe" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="missileStoresTag" name1="DS1" name2="DS1Copy" />
    <copy_object_property property="angle" name1="DS1" name2="DS1Copy" />
    <destroy name="DS1" />
    <!--Create a Command Base to replace DS1-->
    <create type="station" x="StationX" y="StationY" z="StationZ" angle="0" name="DS1" raceKeys="friendly" hullKeys="Command Base base" />
    <copy_object_property property="shieldState" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="canBuild" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="missileStoresHoming" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="missileStoresNuke" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="missileStoresMine" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="missileStoresEMP" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="missileStoresPShock" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="missileStoresBeacon" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="missileStoresProbe" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="missileStoresTag" name1="DS1Copy" name2="DS1" />
    <copy_object_property property="angle" name1="DS1Copy" name2="DS1" />
    <destroy name="DS1Copy" />

The StationX, StationY, and StationZ variables were initialized at the start of the script and DS1 was initially created at that location

Posts: 198
Reply with quote  #5 
Nice!  Thanks for sharing that.
Mike Substelny

Avatar / Picture

Posts: 2,404
Reply with quote  #6 
You could create a generic object using the model and skin of the Command Base, scale it to be larger than normal, then wrap the generic object around the base. That way it would look somewhat the same as it went through the upgrades.
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Previous Topic | Next Topic

Quick Navigation:

Easily create a Forum Website with Website Toolbox.