Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Planet Search Overhaul (07/13/24)

Author Topic: I'm a writer, not a programmer! (some confusion)  (Read 770 times)

happycrow

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
I'm a writer, not a programmer! (some confusion)
« on: October 24, 2024, 04:01:42 PM »

I was able to kinda-sorta follow David's "how to love XL files for writing," but not 100% able to follow near the end. My brain keeps farting out. Could anybody help walk me through some basics? As an historian I have a shitton of ideas but have never touched Java or really any coding since, oh, 1992 and that pretty casually. I can spin probably literal dozens of stuff like the below just from historical parallels, but it's useless unless I can get it to code and offer it to somebody for inclusion as a mod (or make my own and somehow keep it compatible).

Create Jack.
Set Jack findable only on Tri-Tachyon markets.
Set Jack talkable to only if you're not Tri-Tach commissioned.
Jack conversation option: "Talk to the frustrated man haranguing people about workers' rights"

Jack conversation:
"I've got 300 men, women, and teenagers willing to ship out with somebody, ANYBODY, to keep from having to renew their indenture contracts. They're half-trained at best but you can have the lot for 1000 credits that I'll pay their families until they can start sending money home. The catch is, you'll have to train them."

Player responses:
  • Hell no I'm not taking on unskilled greenhorns, get lost. (end convo)
    [/i]
    Sure, I can do that. (end convo. Add 300 crew. JackIsAJerk = #ofCrew-300. If JackIsAJerk<1, JackIsAJerk =1. Set Fleet CR to JackIsAJerk, Jack potential contact)
  • Look. I can't take on charity cases, BUT here's 1000. Go get them some real medical care. (Subtract Wealth. End convo. Jack potential contact)
Logged

David

  • Global Moderator
  • Admiral
  • *****
  • Posts: 969
    • View Profile
Re: I'm a writer, not a programmer! (some confusion)
« Reply #1 on: October 25, 2024, 08:49:36 AM »

Hey! I've attached an image showing how I'd approach implementing this via Rules.

Giant image of a spreadsheet hidden in the spoiler

[close]

Or, better yet, a link to the image.

(It's probably worth me writing a tutorial for simple bar events in the "Rules Clinic" thread, come to think of it. I'll make myself a note to do this, and in that post thoroughly explain all the commands used.)

Issues with my implementation:
- the "add random number of crew" thing just triggers a bunch of rules with a random chance of actually firing. This is a bit of a sloppy hack; it should be handled through a code-side implementation that just does a single random number. This is a lot more complex to explain so I'm not going to attempt it here.
- for similar reasons, there's no hit to player's CR. There isn't a trivial way to do this via rules without writing custom code - I imagine the way to do it is a custom rules call that triggers code which (say) checks the crew level of the player's fleet and gives a CR hit based on that number vs. the 300 (or fewer) that Jack gives to the player.
- I did not include a thing for creating Jack. This I actually did cover in the Rules Clinic thread.
- ... and (as mentioned) I didn't cover anything on the code / making a mod side. I know tutorial(s) for that exist, um, somewhere. (Does someone else know where?)
- and I totally didn't test it! Awful, I know.

I'll do a better post about this... next week, when I have time.
Logged

nathan67003

  • Commander
  • ***
  • Posts: 213
  • Excellent imagination, mediocre implementation.
    • View Profile
Re: I'm a writer, not a programmer! (some confusion)
« Reply #2 on: October 26, 2024, 07:02:00 AM »

I love phpBB and SMF but also I can't upvote stuff on here so I need to actually write up a post to express my appreciation for someone or one of their posts.

Which is what this is.
Logged
I have some ideas but can't sprite worth a damn and the ideas imply really involved stuff which I've no clue how to even tackle.

happycrow

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: I'm a writer, not a programmer! (some confusion)
« Reply #3 on: October 26, 2024, 09:36:14 AM »

Hey, thank you for the reply! I am across town now but as soon as I am home I will dig into it and see what I can understand. Appreciate you!
Logged

happycrow

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: I'm a writer, not a programmer! (some confusion)
« Reply #4 on: October 26, 2024, 01:39:59 PM »

Hey! I've attached an image showing how I'd approach implementing this via Rules.

TY sir!
I think I get how the random# generator is being fired, and the examples are great. (Also, now I can see the RulesClinic thread, how did I manage to miss that before?) What I'm not getting here is:  what determines whether JackSureA fires, vs JackSureB? And does B2 automatically follow B in events?
Logged

David

  • Global Moderator
  • Admiral
  • *****
  • Posts: 969
    • View Profile
Re: I'm a writer, not a programmer! (some confusion)
« Reply #5 on: October 28, 2024, 11:49:06 AM »

What I'm not getting here is:  what determines whether JackSureA fires, vs JackSureB? And does B2 automatically follow B in events?

If a trigger is called with FireBest and it comes up with two or more conditions with the same 'score' (ie. 1. all conditions are valid, and 2. they fulfill the same value of conditions) then one random rule from that set will be called.

BTW I added to the Rules Clinic thread here. So far I've just covered the basic version of this event, but importantly: I made a few corrections and fixed some omissions in the above rules example.
« Last Edit: October 28, 2024, 01:45:50 PM by David »
Logged

happycrow

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: I'm a writer, not a programmer! (some confusion)
« Reply #6 on: October 28, 2024, 02:55:03 PM »

Thank you. This makes my brain melt bc I'm used to the luxury of a toolset, but I'm diving in.  :)
Logged