Request explanation of a script topic

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Betelgeuse wrote:... requesting Curves ...
Do you mean something like this:

Code: Select all

; THX OddBob.
; select a number between start or 0 and target,
; with a decreasing probability of selecting the
; target number. Curve determines the spread.
(setq probability (lambda (target curve start)
    (block (run result)
        (setq run True)
        (if (not start) (setq start 0))
        (setq result start)
        (loop (and run (ls result target))
            (if (leq (random 0 100) curve)
                (setq result (add result 1))
                (setq run Nil)
            )
        )
        result
    )
))
I'm not sure it gives the kind of results you would expect, and it can probably be made give better results, but at least it is usable.

It works like this:

Code: Select all

;; return a number between 1 and 15, with a decreasing chance of returning higher numbers
(probability 15 75 1)
The base number returned is either 0 or the start value (last argument) after this, we enter a loop where we select a number between 0 and 100 randomly and check if this number is lower than the curve (75). If it is, then we to add 1 to the value returned, else we return the value we have immediately. The loop ends either when we select a number higher than the curve, or just before we reach the target number.

This means, that the higher the curve, the more likely we are of getting high numbers.

The function can potentially loop until it reaches target number iterations, so it is not really very efficient, and should only be used for relatively small target numbers (or relatively low curves).

If anybody can improve this, please let me know.

.]
vcant
Anarchist
Anarchist
Posts: 19
Joined: Thu May 12, 2011 11:22 am

I don't understand ALL "ShipClass" section parameters found in many mod for Ship (Player):

Code: Select all

  cargoSpace=
  class=
  cyberDefenseLevel=
  fuelCapacity=
  leavesWreck=
  maneuver=
  manufacturer=
  mass=
  maxArmor=
  maxCargoSpace=
  maxDevices=
  maxNonWeapons=
  maxReactorFuel=
  maxReactorPower=
  maxSpeed=
  maxWeapons=
  reactorPower=
  rotationCount=
  score=
  techOrder=
  thrust=
  type=

can you help me pls?
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

Code: Select all

cargoSpace:
			The amount of cargo the ship can carry, in tons.

class:
			The ship class is how it is identified, ie: the sapphire class, the ei500 class, etc

cyberDefenseLevel:
			Declares a resistance to cyberattack decks like the sung shields down, base playerships have no resistance, I believe it is measured in level.

fuelCapacity:
			How much fuel the ship can initially carry, I believe in standard fuel units, scale it up or down with reactor power.

leavesWreck:
			The probability, in percent, 0 to 100, the ship leaves a wreck when destroyed

maneuver:
			The number of ticks between individual rotations when the ship turns. smaller numbers turn faster.

manufacturer:
			Who or what manufactured the ship, earth industries (EI) for example, no in game effect.

mass:
			The mass of the ship in tons, the higher the mass the less it is moved by momentum weapons and the more it can carry before being overburdened. More mass reduces acceleration if thrust is held constant.

maxArmor:
			The maximum mass of armor segment the ship can mount, in kilograms.

maxCargoSpace:
			The maximum amount of cargo the ship can carry with a cargo hold upgrade, in tons.

maxDevices:
			The maximum number of devices that can be installed.

maxNonWeapons:
			The maximum number of devices that can be installed which are not weapons.

maxReactorFuel:
			I don't know, probably the maximum amount of fuel the ship can carry with a reactor upgrade, safe to leave out.

maxReactorPower:
			I don't know, probably the maximum amount of power the ship can get from any reactor, safe to leave out.

maxSpeed:
			How fast the ship can fly, as a fraction of light speed. 20 is 20%. The freighter is 18, sapphire is 20, wolfen is 25, wind slaver is 30.

maxWeapons:
			The maximum number of weapons that can be installed.

reactorPower:
			How much power the reactor can produce, in tenths of a megawatt. The freighter has 250.

rotationCount:
			How many facings/rotations does the ship have? playerships use 40, npc's use 20, but you can have any number with one restriction. IIRC it must be evenly divisible by four. Keep in mind your ship's image has to match. If you say the ship has 40 facings the image better have 40 facings. So should the drive exhaust image, if used.

score:
			The score earned for destroying this ship, if left out the score is automatically calculated by the game.

techOrder:
			Can be mech(mechanical), biomech(biological and mechanical?), and probably bio(biological). Has no effect in the game, pick your preference.

thrust:
			Controls the thrust of the engines, in tons I believe. The higher the thrust to mass ratio the faster it accelerates.

type:
			An extension of identification, what type of ship is it? yacht, freighter, fighter, gunship, etc.
ImageImage
Thanks to digdug for the banners.
vcant
Anarchist
Anarchist
Posts: 19
Joined: Thu May 12, 2011 11:22 am

thx alot!!!
Post Reply