Knuckle Cracker

Particle Fleet => Map Makers, Ship Builders, and Coders => Topic started by: TripleKings on February 20, 2018, 02:03:22 PM

Title: PRPL Request
Post by: TripleKings on February 20, 2018, 02:03:22 PM
I am trying to make a custom module that provides the ship it is on 5 energy every tick. I followed the advice given by planetfall here. (http://knucklecracker.com/forums/index.php?topic=21624.0) Despite that, I was unable to get anything working. Due to my utter lack of skill in PRPL, I feel like I am forced to ask: Can someone make the scripts for me, then tell me what to do with them?
Title: Re: PRPL Request
Post by: GoodMorning on February 20, 2018, 04:27:58 PM
This ought to work...

"Master" does the work of scanning for ships to attach this module to.
"ShipModule" is the common template for making custom modules build.
"ReactorModule" provides the functionality.

First, copy these into the "scripts" folder for your map.
To use them, place a PRPL Core, and attach "Master".
Currently, it's set up to attach to any ship named "Cheap". Edit "Master" to suit your ship, as described in the thread you linked.

It should work automagically from there. You will need to add an image in the Custom0 slot or the module will be invisible.

Note: I haven't tested this, but it's mostly a copy/paste from an existing module.
The module will not build if your ship is too small to have the relevant hull. The positioning your module on a ship also happens in "Master", and is described in the thread you linked.

Hope this helps. If not, post back here and one of us will help in more detail.
Title: Re: PRPL Request
Post by: TripleKings on February 20, 2018, 06:27:19 PM
Thank you. It works wonderfully, but it seems the module rendered beneath the ship. A gray silhouette appears, but not the unit itself. What do I do?
Title: Re: PRPL Request
Post by: theachevah on February 20, 2018, 06:44:54 PM
Quote from: TripleKings on February 20, 2018, 06:27:19 PM
Thank you. It works wonderfully, but it seems the module rendered beneath the ship. A gray silhouette appears, but not the unit itself. What do I do?

that is the module building.

just wait a bit and it will build.

just like regular modules.
Title: Re: PRPL Request
Post by: TripleKings on February 20, 2018, 06:48:37 PM
It finishes building, leaving the silhouette.
Title: Re: PRPL Request
Post by: FOXX on February 20, 2018, 06:54:35 PM
line 25 in the script should be ->

<-Exist 1 eq if
   Self "main" 255 255 255 127 @SetImageColour
   return
endif

i believe.

gn
FOXX
Title: Re: PRPL Request
Post by: TripleKings on February 20, 2018, 07:17:37 PM
Yes, that was it. Thank you, everyone, for your help.
Title: Re: PRPL Request
Post by: GoodMorning on February 20, 2018, 10:43:47 PM
That's fine. I'm interested to see what you do with it.