Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Excerpt

Determine droid cost from stats...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
go.guessCostFromStats = function(body, propulsion, turret1, turret2, turret3) {
	// ... guess cost ...
 
	return {
		cost: guessedCost,
		certain: <true | false>
	}
}

Parameters

If parameters are not known or are not applicable, they will have a value of undefined.

ParameterTypeMandatoryNotes
body

String

(error)

The body component, if known.

propulsionString(error)

The propulsion component, if known.

turret1String(error)

The first turret, if known.

turret2String(error)

The second turret, if known / applicable.

turret3String(error)The third turret, if known / applicable.

Return value

The return value should be an object stating the cost and whether you are certain (boolean) about the cost.

For example, if all main components are specified (body, propulsion, turret1) and you know the costs of them, you can be pretty certain about the cost.

Notes

The result will usually be cached to some extent, but it's worth adding your own caching to the function where applicable to do so.

Example

<none at present>

Div
classbox
Availability
Status
colourYellow
title3.1

Requires:

The default function is not published on WZ 3.2

or above.GO32 API

+

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5