Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Shadowrgamer

Registered:
Posts: 12
Reply with quote  #1 
I am trying to create a script where the players are tasked with cleaning up a battlefield.  I have the wrecks as I want them. Once scanned I replace them with an generic mesh to give them scan-ability,so I can assign them salvage that can be seen on the 2nd scan and to give Science plenty to do. Each ship is randomly assigned 2 different items, so they have to choose which option to take.  This seems to work fine all the variables show when I log them, and when I put them in the scan message, or on popup messages. 

When I activate my code to add the salvage to the players ship, is where I am having issues. I have successfully added the properties and it seemed to work with a single ship in a single test.  I decided that I would run a quick test with all the ships, 13 in total.  Each ship has 2 options and then comms button that triggers the actual adding of the property based on which option they choose.  (Running this all on one machine with 2 instances of Artemis running 1 server 1 client with Helm, Weapons, Comms, Engineering, and Science.) If I am watching the info on the main screen, it seems to add normally (and shows normal when checking weapons or engineering screens.  When I reach the next ship, I pull up the info to check my numbers before adding the next property and it seems to have increase on its own. For example: 
  • Each Nuke salvaged adds 1, but I had over 20 on my last run through and according to my logs I should have only had 3.
  • The variable that I am adding foe energy is for only 200 but it seems to be adding 1000. 

Code snippet below is when the transfer takes place. 

Questions. 
1. Is this something in my code that is causing the issue? 
2. Is this because I am adding values over the ships normal maximum?   
3. Is there a better way to accomplish this that I haven't seen or thought of? 
4. Why is it showing some of these being picked up as anomalies, when I have the anomalies that I have in the script are disabled? 
     Edit: Seems the anomalies are being picked up with Energy and or Nukes so far as I can tell. 
Thanks for any and all help!

 

<event name="Trasnfer Everythingelse 1-1" id_arme="7d3a7e59-b7fe-4904-a7e3-19b0af0730d4" parent_id_arme="3a70e00a-8d55-45dc-9a30-d558c11adcff">
<if_comms_button text="Transfer Option 1" />
<clear_comms_button text="Transfer Option 2" sideValue="2" />
<clear_comms_button text="Transfer Option 1" sideValue="2" />
<addto_object_property value="Wrk1Energy" property="energy" name="Artemis" />
<set_variable name="TmpSurvivors" value="Survivors" />
<set_variable name="Survivors" value="TmpSurvivors + Wrk1Survivors" integer="yes" />
<set_player_station_carried name="DS1" hullID="100" />
<addto_object_property value="Wrk1EMP" property="countEMP" name="Artemis" />
<addto_object_property value="Wrk1Nuke" property="countNuke" name="Artemis" />
<addto_object_property value="Wrk1Torpedo" property="countHoming" name="Artemis" />
<addto_object_property value="Wrk1Coolant" property="totalCoolant" name="Artemis" />
<set_variable name="TempIntel" value="EnemyIntel" />
<set_variable name="EnemyIntel" value="TempIntel + Wrk1EnemyIntelEnemyIntel" />
<addto_object_property value="Wrk1Mines" property="countMine" name="Artemis" />
<destroy name="Wk1 " />
<big_message title="Survivors And Enemy Intel" subtitle1="Survivors |Survivors| " subtitle2="Enemy Intel |EnemyIntel|" />





Darrin

Registered:
Posts: 86
Reply with quote  #2 
1. I'm not seeing anything hinky in that event, so I'd have to see more of your code.
2. No. The "maximum" ordinance limits are only enforced when a ship docks at a station. There aren't any hard limits on the number of torpedoes/nukes/etc. if you're adding them via a side mission or script event. (There is an integer or float limit for the data type, but you're not likely to exceed it unless something goes horribly wrong.)
3. Don't know, I'd need to see more of the code.
4. If weapons has the wreck targeted with beams, the wreck might be destroyed by damage, which may cause it to drop anomalies. If Artemis is close enough, you won't see the anomalies on the main screen as they will be immediately picked up. I'm guessing the Comms buttons are triggered by proximity, so this code would still work if the wreck has been destroyed by beams, as it may not be checking if the wreck is still there once the buttons are set. You can add code to check what happens after a Transfer button is set but the wreck no longer exists or if Artemis moves away, but that may involve a lot of fugly bookkeeping stuff.

On the server window, use th F7 key to keep track of which events are triggered and which variables are being increased.
Shadowrgamer

Registered:
Posts: 12
Reply with quote  #3 
The wreck themselves should have been destroyed before the player ship arrives typically, as the first scan causes the wreck to be destroyed and a generic mesh to be spawned in its place.  So there is nothing for weapons to lock onto. So that should not cause this.  

I have attached the whole file as it currently sits.  Mission is still in development.   

Any insights you can provide would be wonderful. 


 
Attached Files
zip Miss_Cleanup.zip (38.03 KB, 2 views)

Darrin

Registered:
Posts: 86
Reply with quote  #4 
I've only been playing around with this mission for a few minutes, but here's what I've noticed so far.

The salvage options are randomized, but it looks like you have multiple events with conditionals that trigger on "Transfer Option 1" regardless of which wreck you're  next to. Here's an example, after picking "Transfer Option 1" on the first wreck, three events were triggered: "Trasnfer Everythingelse 1-1", "Transfer Salvage 3-1", and "Transfer Salvage 7-1". (Use the F7 key on the Server screen to toggle through the debugging info.)

cleaup_scr1.png  Your event conditions:

<event name="Trasnfer Everythingelse 1-1" id_arme="7d3a7e59-b7fe-4904-a7e3-19b0af0730d4" parent_id_arme="3a70e00a-8d55-45dc-9a30-d558c11adcff">
<if_comms_button text="Transfer Option 1" />
<if_distance name1="Artemis" name2="Wk1 " comparator="LESS_EQUAL" value="600.0" />

<event name="Transfer Salvage3-1" id_arme="f17b6c84-bced-4a4a-8b03-5eb03cc777c2" parent_id_arme="9e65d848-43d7-4952-a953-2fdfe8483d2d">
<if_comms_button text="Transfer Option 1" />
<if_variable name="Wrk3Salvage" comparator="NOT" value="0.0" />

<event name="Transfer Salvage7-1" id_arme="6eb125e7-f369-4467-99a2-e0d17dd3b341" parent_id_arme="7c630052-6869-4a5f-a420-d11e47b2eb51">
<if_comms_button text="Transfer Option 1" />
<if_variable name="Wrk7Salvage" comparator="NOT" value="0.0" />

Wrk3Salvage is set to Salvage5 + Salvage6 when Combined C event runs. Likewise, Wrk7Salvage is set to Salvage13 + Salvage14 when Combined G event runs. 

Looks like all the "Combined *" events run after the Start event. So right when the game starts, most of your Wrk*Salvage variables are set to non-zero values. 

Ok, tried another game... first wreck only offered Transfer Option 2, that worked fine. Second wreck (Wk13) I picked Transfer Option 1 and it triggered three events:

Transfer Salvage 6-1
Transfer Salvage 11-1
Transfer Salvage 13-1

Same issue. You have multiple salvage events triggering when "Transfer Option 1" is pressed. This might be happening with Transfer Option 2 as well, but I haven't seen it happen yet.

Possible solutions:

1) Don't run your Combined events until the correct wreck mesh is created or until the player ship is close enough to salvage something. This should keep the Wrk*Salvage variables at zero until you need them to be something else. 

2) Add additional conditionals (such as "distance between objects") so Transfer Option 1 isn't triggering multiple salvages. 

3) Use unique button names for each wreck, such as: "Transfer Option 1 for Wreck #13", "Transfer Option 2 for Wreck #3", etc.

Other things I noticed:

Your "Create Anomaly of type <>" commands don't specify which anomaly you're creating, but I think it's defaulting to Energy. If you want to move the anomaly immediately to where the player ship is, you can use 'Set relative position with name "Svg1" to 0 meters 0 degrees starboard relative to themovement direction and location of object with name "Artemis".' (One command instead of three.)

Consider adding some incoming text messages so that Comms has a record of what was picked up. You're using pop-up and main-title messages, but after these messages fade, there's no record of what choices have been selected or what has already been salvaged. 



Shadowrgamer

Registered:
Posts: 12
Reply with quote  #5 
Thanks for the help Darrin, 

I considered changing each of the buttons but was trying for a generic approach to them. I figured since it was all triggered by being in proximity and the transfer events only triggered when in proximity it wasn't an issue.  I will work on that change.  Didn't realize that was an issue. I even saw them in the events list and it didn't click.  Thanks for pointing this out.  

I had all the salvage set to run at startup so they could be scanned.  Allowing them to kinda determine which wreck they wanted to go after when, which is why the combined events run so early. 

As for the anomaly is <> not a random variable for this?   

Thank you for showing me a better way to handle the spawn location.  

The incoming messages are a good idea.  Original intent had been for science to select the option then have a button popup for comms to transfer the salvage / survivors, but that wouldn't work for me.  So I changed to this method.  Still wanted science to make the choice so that is why I was using the popup for options. the big message and other popups were my troubleshooting steps.  

I was planning on a message at the end indicating salvage and enemy intel salvaged so the players knew what they had accomplished, in addition to the rest of the end game.    (My current revision has added that and refined somewhat the survivors and enemy intel issues.  

I will work on these this week and see how things go.  

Thanks again for all your help. 




Shadowrgamer

Registered:
Posts: 12
Reply with quote  #6 
Thanks Darrin for the help. With your suggestions my errors seem to have gone away.  Specifically: 
  • Each option is its own button seems to have eliminated the wrong additions and "random" effects.  I now realize this was pulling the other salvage even though I had a distance set. 
  • I randomized the anomalies so that they now do what I intended.  (though the Mission Editor will not allow variables as an option for the anomaly type, I had to edit that manually) 
  • There are now text messages with information each time something is salvaged from a wreck. 


Sometimes all it takes is a second set of eyes and a fresh perspective.  I appreciate all the help. 

nschlein

Registered:
Posts: 21
Reply with quote  #7 
When you have this ready, can you post the final mission file?
Shadowrgamer

Registered:
Posts: 12
Reply with quote  #8 
Will be running a full crew test this weekend. Provided everything runs smoothly I will be happy post the file.
ogremasch

Avatar / Picture

Registered:
Posts: 195
Reply with quote  #9 
If you want to grab a sneak peek of the file, or just say hi we will likely be streaming the testing as well as gameplay of other missions on Saturday.

http://www.Twitch.tv/gr8alphaogre.

check us out.
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.