|
The Realm Crafter Standard Version Scripting Language |
|
The Realm Crafter engine comes with it's own scripting language and integrated scripting editor. Designed to be simple and forgiving, yet powerful enough to control the game world's many components. The scripting language can be used for writing quests, setting behaviors of actors and items. There are also commands for conversation dialogs with NPCs. The Realm Crafter scripting language is loosely based on BASIC, with C influences. The included Scripting Editor makes adding scripts to your game easy. Below is a list of scripting commands and a sample script to give you an idea of what to expect with Realm Crafter scripting. |
|
Sample Scripting Language Commands
|
|
Ability Commands
AbilityKnown
AbilityLevel
AbilityMemorised
AddAbility
DeleteAbility
SetAbilityLevel
|
Dialog Commands
BubbleChatOutput
CloseDialog
CreateProgressBar
DeleteProgressBar
DialogInput
DialogOutput
OpenDialog
Output
UpdateProgressBar
UpdateXPBar
|
Player Commands
PlayerAccountEmail
PlayerAccountName
PlayerInGame
PlayerIsBanned
PlayerIsDM
PlayerIsGM
|
Quest Commands
CompleteQuest
DeleteQuest
NewQuest
QuestComplete
QuestStatus
UpdateQuest
WaitItem
WaitKill
WaitSpeak
|
Actor Commands
|
|
|
|
Actor
ActorAgressiveness
ActorAIState
ActorBeard
ActorClothes
ActorDestinationX
ActorDestinationZ
ActorDistance
ActorFace
ActorGender
ActorGlobal
ActorGroup
ActorHair
ActorHasEffect
ActorID
ActorIDFromInstance
ActorTrigger
ActorIsHuman
ActorLeader
ActorLevel
ActorMount
ActorOutdoors
ActorPets
|
ActorRider
ActorTarget
ActorUnderWater
ActorX
ActorXP
ActorXPMultiplier
ActorY
ActorZ
ActorZone
AddActorEffect
AnimateActor
Attribute
ChangeActor
ChangeFactionRating
ChangeMoney
Class
ContextActor
CountPartyMembers
DefaultFactionRating
DeleteActorEffect
FactionRating
FindActor
|
FireProjectile
GiveItem
GiveKillXP
GiveXP
Gold
HasItem
HomeFaction
KillActor
MaxAttribute
Money
MoveActor
Name
NextActor
NextActorInZone
OpenTrading
PlaySound
PlaySpeech
Race
Reputation
Resistance
RotateActor
SetActorAIState
SetActorBeard |
SetActorClothes
SetActorFace
SetActorGender
SetActorGlobal
SetActorGroup
SetActorHair
SetActorLevel
SetActorTarget
SetAttribute
SetFactionRating
SetGold
SetHomeFaction
SetLeader
SetMaxAttribute
SetMoney
SetName
SetReputation
SetResistance
SetTag
Spawn
Tag
Warp |
File Commands
|
Item Commands |
World Commands
|
Function Commands |
CloseFile
DeleteFile
Eof
FilePos
FileSize
FileType
OpenFile
ReadByte
ReadFile
ReadFloat
ReadInt
ReadLine
ReadShort
ReadString
SeekFile
WriteByte
WriteFile
WriteFloat
WriteInt
WriteLine
WriteShort
WriteString
|
ActorAmulet
ActorBackPack
ActorBelt
ActorChest
ActorFeet
ActorHands
ActorHat
ActorLegs
ActorRing
ActorShield
ActorWeapon
ItemArmor
ItemAttribute
ItemDamage
ItemDamageType
ItemHealth
ItemMass
ItemMiscData
ItemName
ItemRange
ItemValue
SetItemHealth
SpawnItem |
ActorsInZone
CreateZoneInstance
Day
Hour
Minute
Month
PlayersInZone
SaveState
SceneryOwner
Season
SetOwner
WaitTime
Year
ZoneInstanceExist
ZoneOutdoors |
CallDLL
DoEvents
End
Global
GoTo
GoToIf
MilliSecs
Parameter
Persistent
PlayMusic
RealDate
RealTime
Return
RuntimeError
ScriptLog
SetGlobal
SetSuperGlobal
SuperGlobal
ThreadExecute |
Network Commands
|
String Commands
|
MySQL Commands
|
Math Commands
|
CloseUDPStream
CountHostIPs
CreateUDPStream
DottedIP
HostIP
RecUDPMsg
SendUDPMsg
UDPMsgIP
UDPMsgPort
UDPStreamIP
UDPStreamPort
UDPTimeouts
|
Asc
Chr
FullTrim
Instr
Left
Len
Lower
Mid
Replace
Right
Split
Trim
Upper
|
MySQLClean
MySQLFetchRow
MySQLGetVar
MySQLNumRows
MySQLQuery
SQLAccountID
SQLActorID |
Abs
ACos
ASin
ATan
ATan2
Cos
Exp
Int
Log
Log10
Pi
Rand
Rnd
Sign
Sin
Sqrt
Tan
|
Visual Commands
|
|
|
|
CreateEmitter
CreateFloatingNumber
ScreenFlash
|
|
|
|
Sample Script
|
|
// Guard charges 10 gold to advance into the next zone
Function Main()
Player = Actor()
// Create the conversation window
D = OpenDialog(Player, ContextActor(), "Guard")
// Guard speech
DialogOutput(Player, D, "The crossing charge is 10gp, will you pay?", 255, 255, 255)
// Player makes the choice
Result = DialogInput(Player, D, "Yes", "No")
// Choice 1 (yes)
// If the player selects no, the dialog will just close
If (Result == 1)
// Can the player afford this?
If (Money(Player) > 9)
ChangeMoney(Player, -10)
Output(Player, "10gp removed from inventory")
// Move the player inside
Warp(Player, "Cave", "Entrance")
Else
Output(Player, "You cannot afford this transaction!")
EndIf
EndIf
// Close the conversation window
CloseDialog(Player, D)
// Done
Return()
End Function |
|
|
|
|
|
|
|