Solasta Dungeons Wiki
Advertisement

This script demonstrates controls for requesting and using information about the interacting character. The variant demonstrates how to add randomised responses to each interacting character.

The responses will be to the active character.

Code[]

a=Heroes.Name(0)
Locals.GetString("qname")
Locals.SetString("qname",a)
Locals.GetString("qsurname")
Locals.SetString("qsurname",Heroes.SurName(0))
Locals.GetString("qclass")
Locals.SetString("qclass",Heroes.Class(0))
1


Use the following in Speech:

The fortune teller says, "Greetings, {qname} {qsurname}, respected {qclass}."


All the Heroes attributes that can be called are listed in the scripting reference guide.

Variants[]

Adding an array of responses will provide psuedo-random responses.

 a=Utils.Random(1,7)
 fate[1]="Your future is uncertain."
 fate[2]="Your future is under a shadow of doom."
 fate[3]="Your future shines with wealth."
 fate[4]="Your future blushes with romance."
 fate[5]="I see great peril in your future."
 fate[6]="I see you with a crown on your head and armies on their knees."
 Locals.GetString("qname")
 Locals.SetString("qname",Heroes.Name(0))
 Locals.GetString("qsurname")
 Locals.SetString("qsurname",Heroes.SurName(0))
 Locals.GetString("qclass")
 Locals.SetString("qclass",Heroes.Class(0))
 Locals.GetString("qfate")
 Locals.SetString("qfate",fate[a])
 1

Which will provide Speech the following options:

The fortune teller says, "Greetings, {qname} {qsurname}, respected {qclass}. {qfate}"

Help[]

All Lua scripting is contained within mapname.lua and is specific to each map. Remember to remove DEBUG messages when you have finished testing.

Vip-crown-2-line.png Dungeon Maker PRO User Guide Rocket-line.png Learn Lua in 15 Minutes
Bank-line.png Script Library Discord-line.png Solasta Discord
Advertisement