Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
nschlein

Registered:
Posts: 30
Reply with quote  #1 
I’m reposting this in help because I still haven’t figured this out and no one responded in the scripting forum.

I have a larger mission that I'm working on for my library, and started testing a piece that I thought was a slam dunk...except it isn't working fully.  I'm working in the Mission Editor, using the most recent version.

The idea is the players have picked up a computer virus, and each system is being knocked out one random node at a time until isolation diagnostics are performed on that system.  The code for knockout (mostly) works fine and all my variables and timers are cycling fully when I check the main screen diagnostics...except it will never actually knock a system down to 0% .   Impulse goes to 16% and everything else drops to a minimum of 25%, even after letting it cycle for 15 minutes and confirming that each node variable has registered in the process. Even when I tested just Science (random sensor node to 100% damage, set timer, repeat) it did the same thing.  My only guess was that it had to do with the DamCon teams (which are also being randomly eliminated), but it didn’t change things when I deleted them in testing.  

Any help would be appreciated, because this game relies on various systems being 100% disabled. Here is one system's worth of the offending code; all the others are just variations. TimeWeap is established in the Start block and VirusWeap is established upon infection.

<event name="Weapons Infected" id_arme="ffd91ed8-48fd-4122-82e0-e989a0ba2671">
  <if_variable name="VirusWeap" comparator="EQUALS" value="1.0" />
  <if_variable name="SysWeap" comparator="EQUALS" value="0.0" />
  <if_variable name="NodeWeap" comparator="EQUALS" value="0.0" />
  <if_variable name="NodeWeapMore" comparator="EQUALS" value="0.0" />
  <if_variable name="Virus" comparator="EQUALS" value="1.0" />
  <set_variable name="SysWeap" randomIntLow="1" randomIntHigh="4" />
  <set_variable name="NodeWeap" randomIntLow="1" randomIntHigh="4" />
  <set_variable name="NodeWeapMore" randomIntLow="5" randomIntHigh="10" />
  <set_timer name="CorruptWeap" seconds="TimeWeap" />
</event>

<event name="Beam Downgrade" id_arme="519bdc32-6b8b-4cf9-a076-8fbf56bb3b77">
  <if_timer_finished name="CorruptWeap" />
  <if_variable name="SysWeap" comparator="EQUALS" value="1.0" />
  <if_variable name="NodeWeap" comparator="NOT" value="0.0" />
  <if_variable name="NodeWeapMore" comparator="NOT" value="0.0" />
  <set_player_grid_damage value="1.0" name="Artemis" index="NodeWeap" systemType="systemBeam" countFrom="front" />
  <set_player_grid_damage value="1.0" name="Artemis" index="NodeWeapMore" systemType="systemBeam" countFrom="front" />
  <set_variable name="NodeWeap" value="0.0" integer="yes" />
  <set_variable name="NodeWeapMore" value="0.0" integer="yes" />
  <set_variable name="SysWeap" value="0.0" integer="yes" />
</event>

<event name="Torpedo Downgrade" id_arme="43405ab1-14c1-4674-9866-8ff5549085a9">
  <if_timer_finished name="CorruptWeap" />
  <if_variable name="SysWeap" comparator="EQUALS" value="2.0" />
  <if_variable name="NodeWeap" comparator="NOT" value="0.0" />
  <if_variable name="NodeWeapMore" comparator="NOT" value="0.0" />
  <set_player_grid_damage value="1.0" name="Artemis" index="NodeWeap" systemType="systemTorpedo" countFrom="front" />
  <set_player_grid_damage value="1.0" name="Artemis" index="NodeWeapMore" systemType="systemTorpedo" countFrom="front" />
  <set_variable name="NodeWeap" value="0.0" integer="yes" />
  <set_variable name="NodeWeapMore" value="0.0" integer="yes" />
  <set_variable name="SysWeap" value="0.0" integer="yes" />
</event>


<event name="Front Shields Downgrade" id_arme="a118f621-eaef-40cf-bed2-ade922ae1789">
  <if_variable name="SysWeap" comparator="EQUALS" value="3.0" />
  <if_variable name="NodeWeap" comparator="NOT" value="0.0" />
  <if_timer_finished name="CorruptWeap" />
  <if_variable name="NodeWeapMore" comparator="NOT" value="0.0" />
  <set_player_grid_damage value="1.0" name="Artemis" index="NodeWeap" systemType="systemFrontShield" countFrom="front" />
  <set_player_grid_damage value="1.0" name="Artemis" index="NodeWeapMore" systemType="systemFrontShield" countFrom="front" />
  <set_variable name="NodeWeap" value="0.0" integer="yes" />
  <set_variable name="NodeWeapMore" value="0.0" integer="yes" />
  <set_variable name="SysWeap" value="0.0" integer="yes" />
</event>


<event name="Rear Shields Downgrade" id_arme="3e36637e-6293-4466-9530-d9f3994e2bea">
  <if_object_property property="systemCurEnergyBackShield" name="Artemis" comparator="GREATER_EQUAL" value="0.06" />
  <if_variable name="SysWeap" comparator="EQUALS" value="4.0" />
  <if_variable name="NodeWeap" comparator="NOT" value="0.0" />
  <if_timer_finished name="CorruptWeap" />
  <if_variable name="NodeWeapMore" comparator="NOT" value="0.0" />
  <set_player_grid_damage value="1.0" name="Artemis" index="NodeWeap" systemType="systemBackShield" countFrom="front" />
  <set_player_grid_damage value="1.0" name="Artemis" index="NodeWeapMore" systemType="systemBackShield" countFrom="front" />
  <set_variable name="NodeWeap" value="0.0" integer="yes" />
  <set_variable name="NodeWeapMore" value="0.0" integer="yes" />
  <set_variable name="SysWeap" value="0.0" integer="yes" />
</event>



I also have this oddity happening. 

In addition to damaging systems, I'm disabling all of the DamCon teams, one at a time.  The code for disabling the teams works.  However, I was trying to save their pre-disabled value to a variable and then recall it once the virus is isolated from a certain system.  I used the following code, once for each team, but the events are simply all repeating endlessly, from the very start of the game. Variable TeamA starts at 6.  

<event name="DamCon Team 0 Count Increase Saved" id_arme="5191e9e8-417b-443b-8381-e8b10a058e8f" parent_id_arme="f86549d8-820c-438e-9477-4c85c83cab2d">
  <if_variable name="TeamADisabled" comparator="NOT" value="1.0" />
  <if_damcon_members name="Artemis" team_index="0" comparator="NOT" value="TeamA" />
  <if_damcon_members name="Artemis" team_index="0" comparator="GREATER" value="TeamA" />
  <set_variable name="TeamA" value="TeamA+1" integer="yes" />
</event>

<event name="DamCon Team 0 Count Decrease Saved" id_arme="fceed274-6194-407d-a2ca-2064aaba2940" parent_id_arme="f86549d8-820c-438e-9477-4c85c83cab2d">
  <if_variable name="TeamADisabled" comparator="NOT" value="1.0" />
  <if_damcon_members name="Artemis" team_index="0" comparator="NOT" value="TeamA" />
  <if_damcon_members name="Artemis" team_index="0" comparator="LESS" value="TeamA" />
  <set_variable name="TeamA" value="TeamA-1" integer="yes" />
</event>


Can anyone tell me what is up?

Darrin

Registered:
Posts: 127
Reply with quote  #2 
Damage percentage for the Player Ship is determined by the number of nodes that are knocked out. The number of nodes in a ship will change if the players choose a different ship. A light cruiser has 4 Warp nodes. Warp will only show 0% when all four nodes are knocked out. The light cruiser has 4 beam nodes and 2 torpedo nodes, but that changes if the players select a dreadnought. (I'm assuming in your script that the type of player ship is determined by the script.)

I haven't tested it, but based on the code you posted... it looks like you're just missing "Node 0". If there are four Beam nodes, and you want beams at 0%, you have to knock out node 0, 1, 2, and 3. You're assigning a random value from 1 to 4, so this misses node 0. Thus, Impulse is at 16% (1 out of 6 nodes still active), warp/beams at 25% (1 out of 4 nodes still active). 

For the DamCon count... I'm having trouble determining how "if_damcon_members" works exactly, and get it to work with a counter. For now, you may just have to brute-force it with a series of events:

if VirusStart = YES, Turn DamConACounter = ON
if_damcon_members = 0, set TeamA = 0, turn DamConACounter OFF
if_damcon_members = 1, set TeamA = 1, turn DamConACounter OFF
if_damcon_members = 2, set TeamA = 2, turn DamConACounter OFF
if_damcon_members = 3, set TeamA = 3, turn DamConACounter OFF
if_damcon_members = 4, set TeamA = 4, turn DamConACounter OFF
if_damcon_members = 5, set TeamA = 5, turn DamConACounter OFF
if_damcon_members = 6, set TeamA = 6, turn DamConACounter OFF


nschlein

Registered:
Posts: 30
Reply with quote  #3 
Of course! It never occurred to me that node numbers would start at 0. Damage to xNode-1 should do it.

I’ll try that idea for the DamCons. I was hoping to slim the code down, and still want to know why it is constantly activating, but if this works I won’t cry.

The teens were bummed that I didn’t have the mission ready last week; hopefully next month it will be.

Thanks!
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.