new scripting commands

The place to discuss scripting and game modifications for X³: Reunion.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

new scripting commands

Post by moggy2 » Fri, 18. Nov 05, 00:54

is there a list of the new commands available anywhere yet?

User avatar
Burianek
Posts: 2981
Joined: Mon, 29. Dec 03, 03:29
x3tc

Post by Burianek » Fri, 18. Nov 05, 02:13

Well, they're in the s.e.
As far as a compilted list of just new commands, no, I don't think I've seen anything like that yet.
"Nature's first green is gold" . . . stay golden.

CBJ
EGOSOFT
EGOSOFT
Posts: 51982
Joined: Tue, 29. Apr 03, 00:56
x4

Post by CBJ » Fri, 18. Nov 05, 02:17

This should be most of the new ones, but I can't guarantee I've not missed a few.

Code: Select all

send incoming question %0 to player: callback=%1
set player tracking aim to %0
%0 set hull to %1
%0 set current shield strength to %1
%1%0 get current max speed
%0 = fixed sin %1
%0 = fixed cos %1
%1%0 get production cycle time: account for secondary resources=%2
%1%0 get remaining production cycle time
%1%0 get number of products per cycle
%1%0 get number of resources per cycle for ware %2
%1%0 get production status: as percentage=%2
%1%0 get gate destination: return sector=%2
%1%0 get gate id
%0 get fight rank
%0 get trade rank
%1%0 is known
%0 set known status to %1
%1%0 is detectable
%1%0 is hired
%1%0 get formation
%1%0 serialise object
%1%0 get owned ships: class/type=%2
%1 get ship array: of race %0 class/type=%2
%1 get station array: of race %0 class/type=%2
%0 get player name
%1%0 get tradeable ware array from ship
%1%0 is script %2 on stack of task=%3
%1%0 is task %2 in use
%0 get next gate on route from %1 to %2
%0 get length of string %1
%0 find position of pattern %2 in %1
%0 get substring of %1 offset=%2 length=%3
%0 string %1 to integer
%0 substitute in string %1: pattern %2 with %3
%0 format seconds=%1 to Zura time string
%0%1[%2][%3]
%0[%1][%2] = %3
%0 get index of %2 in array %1 offset=%3 \053 1
register quest script %0 instance multiple=%1
set quest state with message: quest=%0 state=%1 msg=%2
set quest/event %0 timer to %1ms
set quest %0 timeout to %1
%0 add event listener: quest/event=%1 objevent=%2 script=%3
%0 remove event listener: quest/event=%1
%0 display news article: page=%1 newsid=%2 occurrences=%3 maxoffertime=%4 maxtime=%5 placeholder:race1=%6 race2=%7 customarray=%8
change event news availibility: %0 race=%1 sector=%2 jumps=%3
%0[%1] = %2[%3]
%0 square root of %1
%1%0 get current action
%1%0 get array of missiles aiming to me
%0 disable ship rebuild
%1%0 turret %2 can use laser %3
%0 set pirate cover state to %1
%1%0 scan potential pirate %2 for illegal wares
%0 register hotkey %1 to call script %2
unregister hotkey %0
add merchant %0 base=%1 wanted wares=%2 owned wares=%3 cash=%4 rank=%5
%1%0get merchants
remove merchant %0
merchant %0 got ware %1: quantity=%2
merchant %0 sold ware %1: quantity=%2
reset merchant %0 expiry
%0 get data for merchant %1: item number=%2
%0 get random NPC
%1%0 get NPC personal ship
%0 NPC send voice message: id=%1
%0 release NPC personal ship
%0 release NPC
%1%0 NPC wants to bail
%1%0 NPC is aggressive
%0 spawn NPC personal ship: rank=%1
%0 spawn NPC fleet: rank=%1
%1%0 get NPC fleet
%1%0 attack run on target %2 : timeout=%3ms speedlimit=%4
%1%0 get current speed
%1 get power generator of ship/station type %0
%1%0 get power generator
%0 get range of laser %1
%0 get shield damage of laser %1
%0 get hull damage of laser %1
%0 get ammunition of laser %1
%0 get missile range of %1
%0 get missile max damage of %1
%0 get relvalue of %1
register god event: script=%0 mask=%1
%0 order ship in next shipyard: owner=%1 sector=%2 class=%3 optional: default shiptype for race:%4
%0 find nebula: sector=%1 type=%2 effect=%3 flags=%4 refobj=%5 maxdist=%6 maxnum=%7 refpos=%8
%1%0 is hidden
%1%0 is target visible %2
abort god event: %0
finish god event: %0
%0 factory production task: on=%1
%1%0 get scanner range
%0 select and switch lasers for target %1 in turret %2: scan for friends %3
%0 trademaster: is %1 a trader
%0 get warearray for %1
%0 trademaster: add trader=%1 to dock as merchant
trademaster: remove trader=%0 from dock
%0 trademaster: is trader=%1 a merchant
station %0: lock ware %1 for race %2
station %0: unlock ware %1 for race %2
%0 station %1: is ware %2 for race %3 locked
trademaster order: trader=%0 delivery of amount=%1 successful
trademaster order: trader=%0 delivery aborted
%0 trademaster order: find and register order for %1
%1%0 get homesector
%0 set homesector to %1
%1%0 get products
%1%0 uses ware %2 as product
%1%0 get upgrade price: cargo-speed-rot %2 units:%3
gosub %0
endsub
%0 find station: product %1 with best price depend on jumps: max.price=%2, amount=%3, max.jumps=%4, startsector=%5, trader=%6
%0 find station: resource %1 with best price depend on jumps: min.price=%2, amount=%3, max.jumps=%4, startsector=%5, trader=%6
%0 find station sells: resource %1 with best price depend on jumps: max.price=%2, amount=%3, max.jumps=%4, startsector=%5, trader=%6
%1%0 lock ware: %2 on station: %3 for this
%1%0 get defined amount of ware %2 as ship hardware
%1%0 set defined amount of ware %2 as ship hardware
%1%0 get ship hardware as array
%0 find station: product %1 with best price random: max.price=%2, amount=%3, max.jumps=%4, startsector=%5, trader=%6
%0 find station: resource %1 with best price random: min.price=%2, amount=%3, max.jumps=%4, startsector=%5, trader=%6
%0 find station sells: resource %1 with best price random: max.price=%2, amount=%3, max.jumps=%4, startsector=%5, trader=%6
%1%0 get job leader
%1%0 get job idle rate

AalaarDB
Posts: 2282
Joined: Thu, 29. Jan 04, 08:19
x3tc

Post by AalaarDB » Fri, 18. Nov 05, 03:25

These all look great, can you explain how %0 get index of %2 in array %1 offset=%3 \053 1 works? I could use a sequential search that searches an array of arrays where the key is inside the inner array, but I don't think that's what this is :/

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

Post by DeltaWolf » Fri, 18. Nov 05, 10:03

What would be great is if someone could update the MSCI Handbook so that it reflect the SE for X3

(don't look at me :lol: )

Post Reply

Return to “X³: Reunion - Scripts and Modding”