OK... some answers:
is just a compact way of writing this:
Code: Select all
(block (howMany getSegment)
(setq howMany 0)
So, basically, you just initialize `howMany' to 0 at the same time as you define it.
-------------------------------------------------------------------------------------
Code: Select all
(setq installed (shpGetArmor source i))
That above needs to bee seen in the context it appears... inside a `for' loop.
If you look at the
for loop on xelerus you might have an idea to start with.
Basically, the variable `i' always refers to the current iteration in the sequence of numbers from 0 to `segments'.
So, on the first run through, `i' will be 0, on the next 1, and so on, until the loop terminates.
That means that the above code gets the armor installed at position `i'
-------------------------------------------------------------------------------------
When it comes to using it, you have a few choices. You could place the whole function in a <Globals> block
in your mod, and use it there (remember to give the function a propper name). Or, you could just pull out the
block, and put that where you need the code to run. Say, in an event on the Salvager ship.
If you choose the last route, then i would probably take the `getSegment' function, give it a propper name,
and make it global (so you don't need to redefine it every time the event runs)
Hope that makes sense. Just ask and I will try to clarify things.