Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Help me make a mod... about mining... check my work...  (Read 1973 times)

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Help me make a mod... about mining... check my work...
« on: February 23, 2015, 01:52:10 PM »

I'm trying to make a mod that when you land on a gas giant, you can mine volatiles, and it shows you a timer and counts down and then it gives you the volatiles, and so far all I know is that this script is kinda broken and would not work. How would I add volatiles to a player's cargo hold?
The #'s indicate where new "columns" would go in rules.csv
#gasGiantOpen   #OpenInteractionDialog   #$tag:gas_giant   #ShowDefaultVisual      
#gasGiantInit   #InitCommRelayDialog   #$tag:gas_giant   #$menuState = main 0      
#gasGiantMine   #DialogOptionSelected   #$tag:gas_giant         csiProceed:Proceed
                                                                                                csiNevermind:Never mind
#gasGiantProceed   #DialogOptionSelected    #$tag:gas_giant
                                                                 #$option == csiProceed   #Wait $global.csWait 0.5 $global.csFinished $global.csInterrupted $global.csInProgress "Mining- Volatiles"      

#gasGiantFinished   #InitCommRelayDialog    #$tag:gas_giant
                                                                 #$global.csFinished   $menuState = main 0   #You have mined some Volatiles!   
« Last Edit: February 23, 2015, 02:28:32 PM by gruberscomplete »
Logged
Click here for FREE ships!               Plentysector               Robots With Souls

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Help me make a mod... about mining... check my work...
« Reply #1 on: February 25, 2015, 02:09:14 AM »

And where is the script exactly? These are just a set of rules that display text and progress bar.

To make the game add stuff you need to create a specific script which adds cargo to your fleet.

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Re: Help me make a mod... about mining... check my work...
« Reply #2 on: February 25, 2015, 08:50:21 AM »

This is in rules.csv I thought that all I had to do was do that thing above and that the script was part of it? So where'd I put a script, and what kind of script are you talking about?
Logged
Click here for FREE ships!               Plentysector               Robots With Souls

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Re: Help me make a mod... about mining... check my work...
« Reply #3 on: February 26, 2015, 09:08:28 AM »

Please OK so can some1 direct me to a page that help me code? OK guess I'll study exerelins' java files in the mean time...
Logged
Click here for FREE ships!               Plentysector               Robots With Souls

Histidine

  • Admiral
  • *****
  • Posts: 4681
    • View Profile
    • GitHub profile
Re: Help me make a mod... about mining... check my work...
« Reply #4 on: February 26, 2015, 08:36:14 PM »

rules.csv can call functions in com.fs.starfarer.api.impl.campaign.rulecmd; extract the source zip in the Starsector folder or look here for examples.
Write a method to add volatiles to the player fleet's cargo and have rules.csv call it when the mining rule entry is triggered.
Logged