Home » FULL CONTROL GAMES » #JAFDEV Story/Level Design » LUA Scripting Reference
|
Re: LUA Scripting Reference[message #338431]
|
Fri, 19 December 2014 01:01
|
|
Shanga |
|
Messages:3483
Registered:January 2000 Location: Danubia |
|
|
Ingame Quest Functions
A compendium of all the quest functions we have in JAF
(because seeing them in action makes them easier to understand)
Remove item from inventory?
"UserScript": "tactical.RemoveAsset('door_security_keypad_635484673627415808')",
Check quests state
"ConditionsString": "quest.GetQuestState('Q_helicoptercrash') == 'Active'",
Check NPC interaction
"UserScript": "memory.Set('FreddyB', 'Talked')",
"ConditionsString": "memory.Get('TioUrban') == 'Clear' and memory.Get('FreddyB') ~= 'Talked'",
Check quest state
"ConditionsString": "quest.GetQuestState('Q_EveryDayImSmuggling') == 'New'",
Add item to inventory
"UserScript": "inventory.AddItem('', 'Barret_m82A1_B')",
Check quest specific goal
"ConditionsString": "quest.GetGoalState('Q_WhoGaveMyGirlHerpes', 'G1') == 'Active'",
Start NPC dialogue
"UserScript": "dialog.Start('C_WhoGaveMyGirlHerpes', 'Npc_FredBearpit')",
Check inventory for quest item
"ConditionsString": "inventory.HasItem('','Barret_m82A1_B')",
Set quest as failed
"UserScript": "quest.UpdateQuest('Q_EveryDayImSmuggling', 'Failed')",
Remove quest item, set quest goal as completed, set quest as completed, set Steam achievement as completed
Quote:"UserScript": "inventory.RemoveItem('', 'Barret_m82A1_B')\r
quest.UpdateGoal('Q_EveryDayImSmuggling', 'G1', 'Completed')\r
quest.UpdateQuest('Q_EveryDayImSmuggling', 'Completed')\r
achievement.TriggerEvent(\"SideDishCompleted\")",
Add money to player
"UserScript": "strategic.AddMoney(7000)",
Spawn quest enemy in the sector
Quote:"UserScript": "tactical.SpawnNamedEnemy(1722, 'Enemy_Smugglers1', 'East')\r
tactical.SpawnNamedEnemy(2351, 'Enemy_Smugglers', 'East')\r
tactical.SpawnNamedEnemy(3632, 'Enemy_Smugglers1', 'East')\r
tactical.SpawnNamedEnemy(4768, 'Enemy_Smugglers', 'North')\r
tactical.SpawnNamedEnemy(1334, 'Enemy_Smugglers1', 'South')",
Check if a sector is clear
"ConditionsString": "memory.Get('Gazorro') ~= 'Clear'",
Remove a rock map asset to reveal a trap-door
Quote:
"ConditionsString": "memory.Get('Trapdoor') ~= 'Found'",
"UserScript": "tactical.RemoveAsset('rock_swamp_10_81_635501920538277046')",
Set an NPC status as "hireable"
"UserScript": "strategic.SetMercHireable('Nadette_Amina')",
Remove and NPC from the sector map
"UserScript": "tactical.RemoveUnit('Npc_Spirit')",
Check if the player's active squad is full
"ConditionsString": "tactical.IsSquadFull() == false\r
",
Check if player has required sum and substract amount
Quote:"ConditionsString": "strategic.GetMoneyTotal()>838",
"UserScript": "strategic.AddMoney(-839)",
Remove unit as NPC from the map, set unit as hireable, put unit in player's squad
Quote:"UserScript": "tactical.RemoveUnit('Npc_Spirit')\r
tactical.SpawnMerc(6919, 'Nadette_Amina', 'West')\r
strategic.SetMercHireable('Nadette_Amina')\r
strategic.SetUnitHired(\"Nadette_Amina\", 1)",
Check NPC ID as condition
"ConditionsString": "npcID == 'Npc_PapaRalf'",
Check player's inventory for specific item (beer_01), set a quest goal G1 as complete, open as active goal G2
Quote:"ConditionsString": "inventory.HasItem('', 'Beer_01')",
"UserScript": "quest.UpdateGoal('Q_ThrowingOutTrash', 'G1', 'Completed')\r
quest.UpdateGoal('Q_ThrowingOutTrash', 'G2', 'Active')",
Check if player's unit has specific level of skill, set quest goal G2 complete, open goal G3 as active
Quote:"ConditionsString": "tactical.GetUnitStat('', 'Intelligence') > 79",
"UserScript": "memory.Set('Chess', 'Won')\r
quest.UpdateGoal('Q_ThrowingOutTrash', 'G2', 'Completed')\r
quest.UpdateGoal('Q_ThrowingOutTrash', 'G3', 'Active')",
Check player's unit specific skill level
"ConditionsString": "tactical.GetUnitStat('', 'Intelligence') < 80",
Check player's inventory for 2 items, unlock OSIM sectors, set quest status
Quote:"ConditionsString": "inventory.HasItem('', 'Top_Secret_Folder') and inventory.HasItem('', 'OSIM_Note')",
"UserScript": "strategic.UnlockSector('K12')\r
strategic.UnlockSector('K13')\r
memory.Set('Tunnel', 'Opened')",
Set NPC status as "spoken", set TestSubject variable as "release" and if sector status is "Free"
Quote:"ConditionsString": "memory.Get('TheBaronLanshof') ~= 'Spoken' and memory.Get('TestSubject') ~= 'Released' and memory.Get('Osim') == 'Clear'",
Pre-check if squad is full, release TestSubject, set as hireable and add into squad The Baron
Quote:"ConditionsString": "tactical.IsSquadFull() == false",
"UserScript": "memory.Set('TestSubject', 'Released')\r
tactical.RemoveUnit('Npc_RudgarLanshof')\r
tactical.SpawnMerc(2339, 'Rudgar_Lanshof', 'North')\r
memory.Set('Baron', 'Out')\r
strategic.SetMercHireable('Rudgar_Lanshof')\r
strategic.SetUnitHired(\"Rudgar_Lanshof\", 14)",
Report message to a moderator
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 13 02:01:00 GMT+3 2024
Total time taken to generate the page: 0.00911 seconds
|