Difference between revisions of "Scripting"

From Star Wars Combine :: Game Guide
Jump to: navigation, search
Line 1: Line 1:
 
SWC has adopted an in-house scripting language.
 
SWC has adopted an in-house scripting language.
  
 +
==Wildcards==
 
{| border="1" cellspacing="0" cellpadding="5" align="center"
 
{| border="1" cellspacing="0" cellpadding="5" align="center"
 
! SWC Lisp
 
! SWC Lisp
Line 43: Line 44:
 
| ||%character.infofield3% ||Character's 3rd infofield ||2nd Expansionary Fleet ||Empty String ||Yes
 
| ||%character.infofield3% ||Character's 3rd infofield ||2nd Expansionary Fleet ||Empty String ||Yes
 
|-
 
|-
[row][col](get-gender character)[/col][col] %character.gender% [/col][col]Character's gender [/col][col]Male [/col][col]N/A [/col][col]Yes[/col][/row]
+
|(get-gender character) ||%character.gender% ||Character's gender ||Male ||N/A ||Yes
 
|-
 
|-
[row][col][/col][col] %character.unharmed% [/col][col]is Character unharmed? [/col][col]N/A [/col][col]N/A [/col][col]Yes[/col][/row]
+
| ||%character.unharmed% ||is Character unharmed? ||N/A ||N/A ||Yes
 
|-
 
|-
[row][col][/col][col] %character.slightlywounded% [/col][col]is Character slightly wounded? [/col][col]N/A [/col][col]N/A [/col][col]Yes[/col][/row]
+
| ||%character.slightlywounded% ||is Character slightly wounded? ||N/A ||N/A ||]Yes
 
|-
 
|-
[row][col][/col][col] %character.wounded% [/col][col]is Character wounded? [/col][col]N/A [/col][col]N/A [/col][col]Yes[/col][/row]
+
| ||%character.wounded% ||is Character wounded? ||N/A ||N/A ||Yes
 
|-
 
|-
[row][col][/col][col] %character.badlywounded% [/col][col]is Character badly wounded? [/col][col]N/A [/col][col]N/A [/col][col]Yes[/col][/row]
+
| || %character.badlywounded% ||is Character badly wounded? ||N/A ||N/A ||Yes
 
|-
 
|-
[row][col][/col][col] %character.formal% [/col][col]Character's formal greeting [/col][col]Sir/Ma'am [/col][col]N/A [/col][col]Yes[/col][/row]
+
| || %character.formal% ||Character's formal greeting ||Sir/Ma'am ||N/A ||Yes
 
|-
 
|-
[row][col][/col][col] %character.faction% [/col][col]Character's current faction [/col][col]New Republic [/col][col]Freelance [/col][col]Yes[/col][/row]
+
| || %character.faction% ||Character's current faction ||New Republic ||Freelance ||Yes
 
|-
 
|-
[row][col][/col][col] %character.isowner% [/col][col]Is character the owner of the NPC [/col][col]Produces no output [/col][col]Empty String [/col][col]Yes[/col][/row]
+
| || %character.isowner% ||Is character the owner of the NPC ||Produces no output ||Empty String ||Yes
 
|-
 
|-
[row][col][/col][col] %character.ismanager% [/col][col]Is character the manager of the NPC [/col][col]Produces no output [/col][col]Empty String [/col][col]Yes[/col][/row]
+
| || %character.ismanager% ||Is character the manager of the NPC ||Produces no output ||Empty String ||Yes
 
|-
 
|-
[row][col][/col][col] %character.issupervisor% [/col][col]Is character the owner of the NPC [/col][col]Produces no output [/col][col]Empty String [/col][col]Yes[/col][/row]
+
| || %character.issupervisor% ||Is character the owner of the NPC ||Produces no output ||Empty String ||Yes
 
|-
 
|-
[row][col][/col][col] %faction.name% [/col][col]Character's faction's name [/col][col]New Republic [/col][col]Empty string (if freelance) [/col][col]Yes[/col][/row]
+
| || %faction.name% ||Character's faction's name ||New Republic ||Empty string (if freelance) ||Yes
 
|-
 
|-
[row][col][/col][col] %faction.type% [/col][col]Character's faction's type [/col][col]Mining [/col][col]Empty string (if freelance) [/col][col]Yes[/col][/row]
+
| || %faction.type% ||Character's faction's type ||Mining ||Empty string (if freelance) ||Yes
 
|-
 
|-
[row][col][/col][col] %faction.leader% [/col][col]Character's faction's leaders name [/col][col]Ellias [/col][col]Empty String (if freelance) [/col][col]Yes[/col][/row]
+
| || %faction.leader% ||Character's faction's leaders name ||Ellias ||Empty String (if freelance) ||Yes
 
|-
 
|-
[row][col][/col][col] %faction.website% [/col][col]Character's faction's leaders name [/col][col]http://swcombine.com (Link) [/col][col]Empty string (if freelance) [/col][col]Yes[/col][/row]
+
| || %faction.website% ||Character's faction's leaders name ||http://swcombine.com (Link) ||Empty string (if freelance) ||Yes
 
|-
 
|-
[row][col][/col][col] %owner.name% [/col][col]Name of the NPC's owner [/col][col]Darkness [/col][col]Empty string if special owner (Market, None) [/col][col]Yes[/col][/row]
+
| || %owner.name% ||Name of the NPC's owner ||Darkness ||Empty string if special owner (Market, None) ||Yes
 
|-
 
|-
[row][col][/col][col] %owner.entityType% [/col][col]Type of the NPC's owner [/col][col]Faction or Character [/col][col]Empty string if special owner (Market, None) [/col][col]Yes[/col][/row]
+
| || %owner.entityType% ||Type of the NPC's owner ||Faction or Character ||Empty string if special owner (Market, None) ||Yes
 
|-
 
|-
[row][col][/col][col] %character.infofield% [/col][col]Owner's 1st infofield [/col][col]Emperor [/col][col]Empty String [/col][col]Yes[/col][/row]
+
| || %character.infofield% ||Owner's 1st infofield ||Emperor ||Empty String ||Yes
 
|-
 
|-
[row][col][/col][col] %character.infofield2% [/col][col]Owner's 2nd infofield [/col][col]1st Recon Division [/col][col]Empty String [/col][col]Yes[/col][/row]
+
| || %character.infofield2% ||Owner's 2nd infofield ||1st Recon Division ||Empty String ||Yes
 
|-
 
|-
[row][col][/col][col] %character.infofield3% [/col][col]Owner's 3rd infofield [/col][col]2nd Expansionary Fleet [/col][col]Empty String [/col][col]Yes[/col][/row]
+
| || %character.infofield3% ||Owner's 3rd infofield ||2nd Expansionary Fleet ||Empty String ||Yes
 
|-
 
|-
[row][col][/col][col] %location.city% [/col][col]Current city name [/col][col]City 327 [/col][col]Unknown [/col][col]Yes*[/col][/row]
+
| || %location.city% ||Current city name ||City 327 ||Unknown ||Yes*
 
|-
 
|-
[row][col][/col][col] %location.planet% [/col][col]Current planet name [/col][col]Glee Anselm [/col][col]Unknown [/col][col]Yes*[/col][/row]
+
| || %location.planet% ||Current planet name ||Glee Anselm ||Unknown ||Yes*
 
|-
 
|-
[row][col][/col][col] %location.system% [/col][col]Current system name [/col][col]Danju [/col][col]Unknown [/col][col]Yes*[/col][/row]
+
| || %location.system% ||Current system name ||Danju ||Unknown ||Yes*
 
|-
 
|-
[row][col][/col][col] %location.sector% [/col][col]Current sector name [/col][col]Tapani [/col][col]Unknown [/col][col]Yes*[/col][/row]
+
| || %location.sector% ||Current sector name ||Tapani ||Unknown ||Yes*
 
|-
 
|-
[row][col][/col][col] %location.destination% [/col][col]Destination name [/col][col]"Corellia sector" (if deep space)[/col][col][/col][col][/col][/row]
+
| || %location.destination% ||Destination name ||"Corellia sector" (if deep space)||||
 
|-
 
|-
[row][col][/col][col]"Corellia system" (if heading to that system)[/col][col][/col][col][/col][col][/col][col][/col][/row]
+
| ||"Corellia system" (if heading to that system)||||||||
 
|-
 
|-
[row][col][/col][col]"Corellia planet" (if heading in sublight)[/col][col][/col][col][/col][col][/col][col][/col][/row]
+
| ||"Corellia planet" (if heading in sublight)||||||||
 
|-
 
|-
[row][col][/col][col]"Atmosphere (3,4) of Corellia" (if heading in atmo)[/col][col][/col][col][/col][col][/col][col][/col][/row]
+
| ||"Atmosphere (3,4) of Corellia" (if heading in atmo)||||||||
 
|-
 
|-
[row][col][/col][col]"Ground (3,4) of city Cityname on Corellia" (if heading to ground in city)[/col][col][/col][col][/col][col][/col][col][/col][/row]
+
| ||"Ground (3,4) of city Cityname on Corellia" (if heading to ground in city)||||||||
 
|-
 
|-
[row][col][/col][col]"Ground (3,4) at (4,7) on Corellia" (if heading to ground outside a city)[/col][col][/col][col][/col][col][/col][col][/col][/row]
+
| ||"Ground (3,4) at (4,7) on Corellia" (if heading to ground outside a city)||||||||
 
|-
 
|-
[row][col][/col][col][/col][col]Unknown [/col][col]Yes*[/col][col][/col][col][/col][/row]
+
| ||||Unknown ||Yes*||||
 
|-
 
|-
[row][col][/col][col] %location.eta% [/col][col]ETA for current travel [/col][col]3 days, 24 hours and 5 minutes [/col][col]Unknown [/col][col]Yes*[/col][/row]
+
| || %location.eta% ||ETA for current travel ||3 days, 24 hours and 5 minutes ||Unknown ||Yes*
 
|-
 
|-
[row][col](get-name (get-container self))[/col][col] %container.name% [/col][col]Current container name, e.g. the ship or vehicle standing in [/col][col]Tydirium [/col][col]Unknown [/col][col]Yes[/col][/row]
+
| (get-name (get-container self))|| %container.name% ||Current container name, e.g. the ship or vehicle standing in ||Tydirium ||Unknown ||Yes
 
|-
 
|-
[row][col][/col][col] %container.type% [/col][col]Current container type, e.g. the ship or vehicle standing in [/col][col]Lambda Shuttle [/col][col]Unknown [/col][col]Yes[/col][/row]
+
| || %container.type% ||Current container type, e.g. the ship or vehicle standing in ||Lambda Shuttle ||Unknown ||Yes
 
|-
 
|-
[row][col][/col][col] %container.entityType% [/col][col]Current container entity type, e.g. the ship, vehicle, city, planet, station [/col][col]Ship, Vehicle, City, Planet, Space Station [/col][col]N/A [/col][col]Yes[/col][/row]
+
| || %container.entityType% ||Current container entity type, e.g. the ship, vehicle, city, planet, station ||Ship, Vehicle, City, Planet, Space Station ||N/A ||Yes
 
|-
 
|-
[row][col]cgt-year[/col][col] %cgt.year% [/col][col]Gets current CGT year [/col][col]12 [/col][col]N/A [/col][col]Yes[/col][/row]
+
| cgt-year|| %cgt.year% ||Gets current CGT year ||12 ||N/A ||Yes
 
|-
 
|-
[row][col]cgt-day[/col][col] %cgt.day% [/col][col]Gets current CGT day [/col][col]183 [/col][col]N/A [/col][col]Yes[/col][/row]
+
| cgt-day|| %cgt.day% ||Gets current CGT day ||183 ||N/A ||Yes
 
|-
 
|-
[row][col]timeofday[/col][col] %time.ofday% [/col][col]Gets current phase of day [/col][col]Morning, Afternoon, Evening [/col][col]N/A [/col][col]Yes[/col][/row]
+
| timeofday|| %time.ofday% ||Gets current phase of day ||Morning, Afternoon, Evening ||N/A ||Yes
 
|}
 
|}
 
Entries with a "Yes" are available for custom NPCs. Entries with a "Yes*" may have some limitations on their use (e.g. they may not be available when the NPC cannot reliably determine the information without godmodding - for example location whilst in hyperspace).
 
Entries with a "Yes" are available for custom NPCs. Entries with a "Yes*" may have some limitations on their use (e.g. they may not be available when the NPC cannot reliably determine the information without godmodding - for example location whilst in hyperspace).

Revision as of 18:36, 12 November 2014

SWC has adopted an in-house scripting language.

Wildcards

SWC Lisp Old Wildcard Description Example Default For Custom NPCs?
(get-name self) %npc.name% NPC's name Joe Bloggs N/A Yes
(get-race self) %npc.race% NPC's race Nautolan N/A Yes
%npc.infofield% NPC's infofield Master Carpenter N/A Yes
(get-gender self) %npc.gender% NPC's gender Male N/A Yes
%npc.formal% NPC's formal greeting Sir/Ma'am N/A Yes
%npc.ally% is NPC IFF friendly? N/A N/A Yes
%npc.enemy% is NPC IFF enemy? N/A N/A Yes
%npc.neutral% is NPC IFF neutral? N/A N/A Yes
%npc.unharmed% is NPC unharmed? N/A N/A Yes
%npc.slightlywounded% is NPC slightly wounded? N/A N/A Yes
%npc.wounded% is NPC wounded? N/A N/A Yes
%npc.badlywounded% is NPC badly wounded? N/A N/A Yes
(get-name character) %character.name% Character's handle Selatos N/A Yes
(get-race character) %character.race% Character's race Human N/A Yes
%character.infofield% Character's 1st infofield Emperor Empty String Yes
%character.infofield2% Character's 2nd infofield 1st Recon Division Empty String Yes
%character.infofield3% Character's 3rd infofield 2nd Expansionary Fleet Empty String Yes
(get-gender character) %character.gender% Character's gender Male N/A Yes
%character.unharmed% is Character unharmed? N/A N/A Yes
%character.slightlywounded% is Character slightly wounded? N/A N/A ]Yes
%character.wounded% is Character wounded? N/A N/A Yes
%character.badlywounded% is Character badly wounded? N/A N/A Yes
%character.formal% Character's formal greeting Sir/Ma'am N/A Yes
%character.faction% Character's current faction New Republic Freelance Yes
%character.isowner% Is character the owner of the NPC Produces no output Empty String Yes
%character.ismanager% Is character the manager of the NPC Produces no output Empty String Yes
%character.issupervisor% Is character the owner of the NPC Produces no output Empty String Yes
%faction.name% Character's faction's name New Republic Empty string (if freelance) Yes
%faction.type% Character's faction's type Mining Empty string (if freelance) Yes
%faction.leader% Character's faction's leaders name Ellias Empty String (if freelance) Yes
%faction.website% Character's faction's leaders name http://swcombine.com (Link) Empty string (if freelance) Yes
%owner.name% Name of the NPC's owner Darkness Empty string if special owner (Market, None) Yes
%owner.entityType% Type of the NPC's owner Faction or Character Empty string if special owner (Market, None) Yes
%character.infofield% Owner's 1st infofield Emperor Empty String Yes
%character.infofield2% Owner's 2nd infofield 1st Recon Division Empty String Yes
%character.infofield3% Owner's 3rd infofield 2nd Expansionary Fleet Empty String Yes
%location.city% Current city name City 327 Unknown Yes*
%location.planet% Current planet name Glee Anselm Unknown Yes*
%location.system% Current system name Danju Unknown Yes*
%location.sector% Current sector name Tapani Unknown Yes*
%location.destination% Destination name "Corellia sector" (if deep space)
"Corellia system" (if heading to that system)
"Corellia planet" (if heading in sublight)
"Atmosphere (3,4) of Corellia" (if heading in atmo)
"Ground (3,4) of city Cityname on Corellia" (if heading to ground in city)
"Ground (3,4) at (4,7) on Corellia" (if heading to ground outside a city)
Unknown Yes*
%location.eta% ETA for current travel 3 days, 24 hours and 5 minutes Unknown Yes*
(get-name (get-container self)) %container.name% Current container name, e.g. the ship or vehicle standing in Tydirium Unknown Yes
%container.type% Current container type, e.g. the ship or vehicle standing in Lambda Shuttle Unknown Yes
%container.entityType% Current container entity type, e.g. the ship, vehicle, city, planet, station Ship, Vehicle, City, Planet, Space Station N/A Yes
cgt-year %cgt.year% Gets current CGT year 12 N/A Yes
cgt-day %cgt.day% Gets current CGT day 183 N/A Yes
timeofday %time.ofday% Gets current phase of day Morning, Afternoon, Evening N/A Yes

Entries with a "Yes" are available for custom NPCs. Entries with a "Yes*" may have some limitations on their use (e.g. they may not be available when the NPC cannot reliably determine the information without godmodding - for example location whilst in hyperspace).