<RetVar/IF><RefObj> get object name array

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

Locked
mark_a_condren
Posts: 1385
Joined: Wed, 3. Aug 05, 05:05
x3tc

<RetVar/IF><RefObj> get object name array

Post by mark_a_condren » Wed, 22. Sep 10, 19:27

[skip|else] if [not]|while [not]| <RetVar/IF> = <RefObj> get object name array


[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Command return, with an 'if' statement used it will be TRUE (1) if condition passes or FALSE (0) if it fails, otherwise if you use a 'Variable', this variable will be an array containing the relivant page and text entry information.
<RefObj> = The object you wish to get the name array for.


The <RefObj> must be an existing in game object for this command to work, if it is used on an invalid object it will return null.

This command returns the array that the game engine uses for speech.

This array can then be put directly into the speak text array command.
Doing it for a ship should speak the exact name of the ship, this includes its true name and race, or job title, etc

The returned array will consist of 16 elements. This array is made up of a sequence of Page ID's and Text ID's. If the object has an entry in one or more of the page / text id's that are part of the array structure, they will be entered into the array automatically, else a 0 will be inserted into the array. The array elements containing values other than 0 will depend on the <RefObj> this command is returning the array for.

--------------------------------------
Known Invalid Objects,
  • Docks
    Gates
    Asteroids
(this list is by no means exhaustive and possibly far from complete)
--------------------------------------


Example:

It should be noted that from testing done, particular care should be taken to ensure the 'name array' exsists before trying to use it. Failing to do this has resulted in unexpected script behaviour.

$this.object = get player tracking aim

If = $this.object get object name array
$object.name.array = $this.object get object name array
START = speak array: $object.name.array prio =100

end

The name array will first be retrieved for the player target and if it is a valid name array it will be inserted into the 'speak array' command and spoken by 'Betty'. Using START as the command prefix allows the script to continue on while the text is being spoken.


Additional Information:

Array Composition,

The array elements are treated as 8 pairs of entries. ie index 0 and 1 are 1 pair, index 2 and 3 are another pair ...
Each pair combination is a reference to a Page id and a Text id. Thus giving the location of the text to be spoken. If a valid entry is not found the array pair is ignored and the next pair is checked.
  • Pair 0
    • $object.name.array [ 0 ] = 13 (Page 13)
      $object.name.array [ 1 ] = 1328 (Page 13 text id 1328)
      • Reading page 13 t id 1328 = {1}{2}{3}{4}{5}{7}{6}.
        This is the reference used by the speak array command to tell it what order to speak the array pairs in.
        If a valid entry is not found the array pair is ignored and the next pair is checked.
        All tests run so far have always resulted in the same entries of 13 and 1328 for this pair.
  • Pair 1
    • $object.name.array [ 2 ] = 1000 (Page 1000)
      $object.name.array [ 3 ] = # (Page 1000 text id #)
      • Reading page 1000 t id # = Argon, Boron, Paranid, Yaki, etc
        This pair is only valid if <RefObj> is a ship or station containing a race designation component to its name.
  • Pair 2
    • $object.name.array [ 4 ] =
      $object.name.array [ 5 ] =
      • After quite extensive testing, no return has been experience for this pair to allow values to be aquired.
  • Pair 3
    • $object.name.array [ 6 ] = 1000 (Page 1000)
      $object.name.array [ 7 ] = # (Page 1000 text id #)
      • Reading page 1000 t id # = Civilian, Military, OTAS, Police, etc
        This pair is only valid if <RefObj> is a ship containing a Jobs File designation component to its name.
  • Pair 4
    • $object.name.array [ 8 ] = 17 (page 17)
      $object.name.array [ 9 ] = # (page 17 t id #)
      • Reading page 17 t id # = Barracuda, Advanced Satellite, Large Orbital Weapons Platform, Wheat Farm, Solar Power Plant, etc
        This pair is only valid if <RefObj> is a ship or station containing a type designation component to its name.
  • Pair 5
    • $object.name.array [ 10 ] = 17 (page 17)
      $object.name.array [ 11 ] = # (page 17 t id #)
      • Reading page 17 t id # = Sentinel, Vangaurd etc
        This pair is only valid if <RefObj> is a ship containing a ship variant designation component to its name.
  • Pair 6
    • $object.name.array [ 12 ] = 12 (Page 12)
      $object.name.array [ 13 ] = # (Page 12 text id #)
      • Reading page 12 t id # = alpha, beta, gamma etc
        This pair is only valid if <RefObj> is a station containing a greek designation component to its name.
  • Pair 7
    • $object.name.array [ 14 ] = 12 (Page 12)
      $object.name.array [ 15 ] = # (Page 12 text id #)
      • Reading page id 12 t id # = S, M, L, XL and XXL
        This pair is only valid if <RefObj> is a station containing a size designation component to its name.

Notes:

It would appear that the resulting speach for elements 14 and 15 is spoken before the speach for elements 12 and 13.


Sample array return:

Argon Police Discoverer Raider
  • 13
    1328
    1000
    101
    0
    0
    1000
    30002
    17
    3151
    17
    10003
    0
    0
    0
    0
With relivant text entries inserted for demonstration purposes.

Argon Police Discoverer Raider
  • 13
    1328, {1}{2}{3}{4}{5}{7}{6}.
    1000
    101, Argon.
    0
    0, 0.
    1000
    30002, Police.
    17
    3151, Discoverer.
    17
    10003, Raider.
    0
    0, 0.
    0
    0, 0.

Command Location:
Last edited by mark_a_condren on Sun, 26. Sep 10, 17:55, edited 7 times in total.

Locked

Return to “MSCI Reference”