Zolton's Tools - 01/10/14 08:49 PM
I tried to use the powerful story editor that Larian provided, but if you want to make anything work the way you think it should, there needs to be A LOT of support scripts. Fortunately they provided us the main game's scripts. However it's still not enough, we don't know how to use the tools they created for the main game. So I started the project of cataloging the tools they used and giving a brief description of what those are and how they are to be used. I am avoiding all the internal workings and only describing those databases and procedures one should use in creating your game.
This is what i got so far
////////////// TABLE OF CONTENTS ////////
[spoiler]
ZOLTON'S DIVINITY ENGINE STORY EDITOR TOOLS
Version 0.3.0
---Characters
Moves Character
COMBAT
---Dialogs
Dialogs
Dialog 2
One Shot Dialog
Player Comments
Party Dialog
Warning Dialogs
---NPCs
Shop Owners
Companions and Henchmen
Food For Animals
Relations
Attitude
Persuasion
---Items
Doors
Hidden Walls
Shoveling Stuff
---Areas
CIRDialog
Exploration Bonuses
Forbindden Areas
---Illegal
Illegal Poop
---Player Management
SubRegion
Journal & Discription
Tutorial Messages
---General
Some Book keeping
Autosave
Counters
Kill Counters
Object Timers
[/spoiler]
//------------------------Characters-------------------------//
[spoiler]
[php]
/////Moves Character///////////
/* Notes
This Section is about moving a Character from one point to another, keeping and restoring their normal behaviors
They will also Stop if attacked and resume when they leave combat. Upon death the events and databases will be cleaned up
Nice work Larin
*/
/****Invovled Databases****/
/****Usefull Procedures****/
ProcCharacterMoveToTrigger((CHARACTER)_Char,(TRIGGER)_Point,(INTEGER)_Running,(STRING)_Event);
ProcCharacterMoveToItem((CHARACTER)_Char,(ITEM)_Point,(INTEGER)_Running,(STRING)_Event);
/* Define Keywords
(CHARACTER)_Char : Move this Character
(TRIGGER)_Point : Move to this Trigger
(ITEM)_Point : Move to this item
(INTEGER)_Running : is running? 0->False 1->True
(STRING)_Event : I believe event upon completion (goes into CharacterMoveToTrigger())
*/
/////COMBAT///////////
/* Notes
Combat is generated by background scripts
*/
/****Invovled Databases****/
dbCombat((CHARACTER)_Character,(INTERGER)_ID); //Generated
//database containing all characters currently in combat, Useful as a check for if a characcher is in combat ex: NOT dbCombat(_Character,_ID)
/****Usefull Procedures****/
/* Define Keywords
(CHARACTER)_Character : Character in combat (generated)
(INTERGER)_ID : Combat interger ID (generated)
*/
[/php][/spoiler]
//------------------------Dialogs-------------------------//
[spoiler][php]
//////Dialogs/////////////
/* Notes
Thi part sets up dialogs when you click on the global character
*/
/****Invovled Databases****/
//main way of adding dialog to global units
DB_Dialogs((CHARACTER)_Npc,[(CHARACTER)_Npc2,(CHARACTER)_Npc3,(CHARACTER)_Npc4,](STRING)_Dialog);
DB_AD_Dialog((CHARACTER)_Character,(STRING)_Dialog);
/****Usefull Procedures****/
ProcRemoveDialogEntryForSpeaker((CHARACTER)_NPC,(STRING)_Dialog);
ProcRemoveAllDialogEntriesForSpeaker((CHARACTER)_NPC);
DB_ItemGivesDualDialog((ITEM)_Item,(STRING)_Dialog);
ProcRemoveNPCADs((CHARACTER)_Npc); //Removes all Automatic dialogs
//used Once in main game, adding items to DB_Dialogs should work
ClearDefaultDialog((CHARACTER)_Npc);
SetDefaultDialog((CHARACTER)_Npc,(STRING)_Dialog,(INTEGER)_CloseButtonEnabled);
/* Define Keywords
*/
/////////Dialog 2/////////////
/* Notes
This type of dialog deals with triggered dialogs, use them in procedures
threaten means you have a weapon out
*/
/****Invovled Databases****/
DB_CustomThreatenDialog((CHARACTER)_Npc,(STRING)_Dialog);
DB_CustomThreatenGroupDialog((STRING)_Group,(STRING)_Dialog);
DB_CustomCompanionGroupDialog(_Group,_Dialog);
DoStartDialog((CHARACTER)_Player, (INTEGER)_Mode);
DB_CustomCompanionDialog((CHARACTER)_Npc,(STRING)_Dialog);
SetDefaultThreatenedDialog((CHARACTER)_Npc,(STRING)_Dialog);
/****Usefull Procedures****/
SetAndStartDialog((CHARACTER)_Player,(CHARACTER)_Npc,(STRING)_Dialog[,(INTEGER)_EnableCloseButton]); //Starts a dialog reatively safe
DoStartDialog((CHARACTER)_Player,(CHARACTER)_Npc,(STRING)_Dialog); //Used by NPC_Actions, no dialog buffer unlike SetAndStartDialog
ProcStartCompanionDialog((CHARACTER)_Player,(CHARACTER)_Npc); //This one just has an extra tutorial as far as I can tell, can do custom or default
/* Define Keywords
(CHARACTER)_Player :
(CHARACTER)_Npc :
(STRING)_Dialog :
(INTEGER)_EnableCloseButton : Default to 1
*/
/*****Dialog Events******/
/**Put away weapons during dialog
Character Event Set :"EVENT_npc_player_puts_down_weapons_for"
***NPC Attacks after Dialog
Character Event Set :"EVENT_npc_player_attacks"
*/
/*****Stored Data*****/
TalkedToPlayer(_Player,_Npc); //Remembers if you talked to an NPC
RanDialog(_Player,_Dialog); //Remembers if you ran a dialog
/*********Special*********/
//If you used DoStartDialog you can preload an event for the upcoming conversation by adding another definition of the PreStartDialog Procedure
/* Simple Example
PROC
PreStartDialog((CHARACTER)_Player,(CHARACTER)_Npc,"MyDialogName")
//AND Conditions
THEN
SetAndRememberDialogEvent(_Player,"MyEventName",0);
*/
/////One Shot Dialog///////////
/* Notes
Basicly all the dialogs that only happen once, luckly larin named these relatively well.
There are brackets around certain databases you don't nessassarily need (you can have that many NPCs conversing, might be a problem with having 4).
*/
/****Invovled Databases****/
OneShotPlayerOnlyTrigger((TRIGGER)_Trigger);
DB_OneShot_PlayerOnlyDialogTrigger((TRIGGER)_Trigger,(STRING)_Dialog,(CHARACTER)_NPC);
DB_OneShot_DialogTrigger((TRIGGER)_Trigger, (STRING)_Dialog,(CHARACTER)_NPC [, (CHARACTER)_NPC2, (CHARACTER)_NPC3, (CHARACTER)_NPC4]);
DB_OneShot_DialogItem((ITEM)_Item, (STRING)_Dialog [, (CHARACTER)_NPC, (CHARACTER)_NPC2, (CHARACTER)_NPC3, (CHARACTER)_NPC4]); //happens upon use of item
DB_OneShot_ADTrigger((TRIGGER)_Trigger,(STRING)_Dialog,(CHARACTER)_NPC[,(CHARACTER)_NPC2]); //not sure differncebetween this and DB_OneShot_DialogTrigger
/****Usefull Procedures****/
/* Define Keywords
(TRIGGER)_Trigger : Dialog occurs at this trigger
(STRING)_Dialog :
(CHARACTER)_NPC(s) : NPC included in dialog
*/
/////Player Comments////////////////
/* Notes
If you want A Player Character to make a comment about somthing
May Require 2 players
*/
/****Invovled Databases****/
DB_PlayerComments((STRING)_Comment, (STRING)_Text, (INTERGER)_PlayerAmount, (INTERGER)_Current);
DB_PlayerComment_Trigger((TRIGGER)_Location,(STRING)_Comment);
DB_PlayerComment_Event((STRING)_Event, (STRING)_Comment); //Not used in main game
PROC_CompanionComment((STRING)_ID, (CHARACTER)_Companion); //Non-Larin
/****Usefull Procedures****/
Launch_PlayerComment((CHARACTER)_Player,(STRING)_Comment);
/* Define Keywords
(STRING)_Comment : Unique ID for each comment
(STRING)_Text : Text Displayed
(CHARACTER)_Player : The player that makes the comment
(INTERGER)_PlayerAmount : Ammount of players required to be present
(INTERGER)_Current : On current comment
(CHARACTER)_Companion : Campanion That comments
*/
/////Party Dialog///////////
/* Notes
*/
/****Invovled Databases****/
DB_KillCounterGivesPartyDialog((STRING)_Name, (INTEGER)_Count, (STRING)_Dialog);
DB_ItemGivesPartyDialog((ITEM)_Item,(STRING)_Dialog);
DB_EventGivesPartyDialog((STRING)_Event,(STRING)_Dialog);
DB_TriggerGivesPartyDialog((TRIGGER)_Trigger,(STRING)_Dialog);
DB_CharacterEventGivesPartyDialog((CHARACTER)_Character,(STRING)_Event,(STRING)_Dialog);
/****Usefull Procedures****/
ProcDefinePartyDialog((STRING)_Dialog); //Used in Infected Dog Mission, and more...
ProcCancelPartyDialog((STRING)_Dialog); //Cancel Specific party dialog
ProcCancelDualDialogs(); //Cancels all party dialogs
/* Define Keywords
(STRING)_Dialog : Active Party Dialog ID
(INTEGER)_Count : Count target for kill counter
(ITEM)_Item : Item that upon use gives party dialog
(STRING)_Event : Global Event that gives party dialog
(TRIGGER)_Trigger : Trigger that upon trip gives party dialog (one time)
*/
/////Warning Dialogs///////////
/* Notes
Combat Warnings are entering combat shoutouts if the player is already in combat
Warnings are dialogs
If the player attacks someone they get a couple chances before they DoRevengeOnAttack
EvilDude : 0
Companion: 3
Good standing (>=0 attitude) : 3
Bad Standing (<0 attitude) : 2
*/
/****Invovled Databases****/
dbCustomCombatWarningDialog((STRING)_Faction,_Dialog); //If player is in comabt and is joined by NPC
DB_CustomWarningDialog(_Npc,(STRING)_Dialog); //For NPC player interaction upon illegal activity, overrides faction dialogs
DB_CustomFactionWarningDialog(_Faction,(STRING)_Dialog); //For NPC player interaction upon illegal activity, overrides group dialogs
DB_CustomGroupWarningDialog(_Group,_Dialog); //For NPC player interaction upon illegal activity, overrides default dialog
/****Usefull Procedures****/
/******Default Dialogs******/
//Default combat warning Dialog: "please_dont_attack_combat"
//Default Warning Dialog: "please_dont_attack"
/* Define Keywords
*
[/php][/spoiler]
//------------------------NPCs-------------------------//
[spoiler][php]
/////Shop Owners///////////
/* Notes
This sets up standard warnings and threatened message for shopkeepers
*/
/****Invovled Databases****/
ShopRegion((STRING)_Level,(TRIGGER)_Region,(CHARACTER)_ShopKeeper,(STRING)_?);
ItemOwnerShipTriggers((STRING)_Level,(TRIGGER)_Region,(CHARACTER)_ShopKeeper)
/****Usefull Procedures****/
/* Define Keywords
(STRING)_Level : Name of level shop is on (ex:"Cyseal")
(TRIGGER)_Region : Trigger region of Shop
(CHARACTER)_ShopKeeper : Shopkepper
(STRING)_? : Unused
*/
/////Companions and Henchmen///////////
/* Notes
*/
/****Invovled Databases****/
DB_AttackDialog(_companion, _dialog); //custom dialog for when limit reached of being attacked
DB_HenchmanPool((CHARACTER)_Char);
/****Usefull Procedures****/
/******Default Dialogs******/
//Dialog if a henchmen leaves the party: "Henchman_LeavesParty" on attack
/* Define Keywords
*
/////Food For Animals///////////
/* Notes
Found this and I don't think it's used in the main game
I'm pretty sure its linked to animal charScripts
*/
/****Invovled Databases****/
DB_AnimalFoodVars((STRING)_Var);
/****Usefull Procedures****/
ProcSetAnimalFoodEvents((CHARACTER)_Player,(CHARACTER)_Npc);
ProcGiveAnimalFood((CHARACTER)_Player,(CHARACTER)_Npc);
/* Define Keywords
*/
/////Relations///////////
/* Notes
*/
/****Invovled Databases****/
/****Usefull Procedures****/
SetRelationFactionToPlayers((STRING)_Faction,(INTEGER)_Relation);
SetRelationIndivFactionToPlayers((CHARACTER)_char,(INTEGER)_Relation);
ProcSetRelationToPlayers((CHARACTER)_Character,(INTEGER)_Relation);
ChangeAttitude((CHARACTER)_NPC,(CHARACTER)_Player,(INTEGER)_Value);
/* Define Keywords
*/
/////Attitude///////////
/* Notes
If you attack someone that the player has greater or equal to then 25 reputation towards you, they will start warning dialog
If you attack a pet and the owner can see you they will start "Default_AttackPet" Dialog with you become hostile and try to call the gaurds in the region
*/
/****Invovled Databases****/
IsNotMessingAround(_Npc) //Won't stop and chat if you attack them
EvilDude(_Npc) //Disabled reputation's effects on character
WarningDialog(_Npc,_Dialog); //Custom Warning Dialog for NPC
/****Usefull Procedures****/
SetAttitudeToAtLeast((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_MinAtt);
SetAttitudeToAtMax((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_MaxAtt);
SetRepAttitudeToAtLeast((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_MinRepAtt);
DecreaseAttitude((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_Delta);
IncreaseAttitude((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_Delta);
SetHostileAtt((CHARACTER)_Npc,(INTEGER)_Att); //NPC becomes hostile when at at or below the HostileAtt, becomes unhostile when above. Not used in Game
/*****Character Events*****/
//Dialog Character Event "EVENT_npc_attitude_up" increases attitude of players in dialog by 10
//Dialog Character Event "EVENT_npc_attitude_down" decreases attitude of players in dialog by 10
//Dialog Character Event "EVENT_npc_attitude_up_25" increases attitude of players in dialog by 25
//Dialog Character Event "EVENT_npc_attitude_down_25" decreases attitude of players in dialog by 25
//Dialog Character Event "EVENT_npc_attitude_up_50" increases attitude of players in dialog by 50
//Dialog Character Event "EVENT_npc_attitude_down_50" decreases attitude of players in dialog by 50
/* Define Keywords
*
/////Persuasion///////////
/* Notes
This section creates the persuasion possiblities. The standard are Intimidate, Charm, and Logic.
I am unsure I you can add more options to this list, one would need to look at a couple calls
All the information boils down into StartDialogConflict call.
It aquires information from the ability information from CharacterGetAbility query
Network? - kinda confused on this one
if a "Set_Persuasion_Flags" is set in a dialog and one or both player characters have higher then 10 perception,
it will call DialogSetNodeFlag (?) and flag it something in Dialog.
This all exist in the file _Glo_IntimidateCharmLogic
*/
/****Invovled Databases****/
dbDialogPersuasionEvents((STRING)_Event,(STRING)_LocalEvent,(STRING)_Text);
dbDialogPersuasionNodes((INTERGER)_?, (STRING)_?);
/****Usefull Procedures****/
/* Define Keywords
(STRING)_Event : Name of persusion event (ex: "ApplyReason", or "ApplyIntimidate") can be anything vent named here
(STRING)_LocalEvent : Name of event localy (ex: "Reason", or "Charm") can be anything vent named here
(STRING)_Text : Name of String to be shown
*/
[/php][/spoiler]
//------------------------Items-------------------------//
[spoiler][php]
/////Doors///////////
/* Notes
*/
/****Invovled Databases****/
/****Usefull Procedures****/
ItemCloseAndLock((ITEM)_Item,(STRING)_Key);
ItemUnlockAndOpen((ITEM)_Item);
/* Define Keywords
*/
/////Hidden Walls///////////
/* Notes
To create a hidden wall and the wway to open it one must run the procedure PROC_RegisterHiddenWall on the wall
you can then create your own Procedure to then assign a way to open it. An example is provided
*/
/****Invovled Databases****/
HiddenWallDB((INTEGER)_WallIndex, (ITEM)_Wall); //Generated by PROC_RegisterHiddenWall
HiddenWallItemDB((ITEM)_Item, (INTEGER)_WallIndex);
//PROC_CommentHiddenEffect is a procedure that occurs when a HiddenWallItemDB is used and plays one of 4 lines, I have disabled it
HiddenWallEventDB((STRING)_flag, (INTEGER)_wallIndex);
HiddenWallTriggerDB((TRIGGER)_Trigger, (INTEGER)_wallIndex); //Opens wall when someone is in the trigger area, closes up when no one is :)
/****Usefull Procedures****/
PROC_RegisterHiddenWall((ITEM)_Wall);
/****Special****/
//Item Event "Open" on a hidden wall will open the wall
/*
PROC PROC_RegisterWaysToOpenHiddenWall()
AND HiddenWallDB(_WallIndex, (ITEM)_Wall)
THEN
HiddenWallItemDB((ITEM)_Item,_WallIndex);
*/
/* Define Keywords
(INTEGER)_WallIndex : generated number
(ITEM)_Wall : The hidden wall to be opened
(ITEM)_Item : Item upon usage opens wall
(TRIGGER)_Trigger : Trigger Zone to activate wall
(STRING)_flag : Global flag that upon set opens wall
*/
///////Shoveling Stuff/////////////
/* Notes
Script for shoveling
If its in the database the reward(s) spawn upon completing the dig
*/
/****Invovled Databases****/
DB_ShovelArea((TRIGGER)_Area, (STRING)_Reward, (ITEM)_Dirt);
DB_ShovelRewardComment((STRING)_Reward, (STRING)_Comment); //Test with Test_Greever
DB_ShovelRewardItemAppear((STRING)_Reward, (ITEM)_Item,(TRIGGER)_Spawn);
DB_ShovelRewardItemAdd((STRING)_Reward, (ITEM)_Item);
DB_ShovelRewardCharacterAppear((STRING)_Reward,(CHARACTER)_Character);
DB_ShovelRewardItemSpawn((STRING)_Reward,(ITEM)_Item);
DB_ShovelRewardItemTemplate((STRING)_Reward,(STRING)_ItemTemplate,(INTEGER)_Amount);
DB_ShovelRewardEvent((STRING)_Reward,(STRING)_Event);
DB_ShovelRewardSurface((STRING)_Reward,(TRIGGER)_Trigger, (STRING)_Type, (REAL)_Radius);
/****Usefull Procedures****/
/* Define Keywords
(TRIGGER)_Area : Player must be in this trigger area
(ITEM)_Dirt : The dirt mount that appears at end of dig
(STRING)_Reward : Name of Reward
(ITEM)_Item : Item given upon completion
(TRIGGER)_Spawn) : Reward is moved to this trigger
*/
[/php][/spoiler]
//------------------------Areas-------------------------//
[spoiler][php]
/////Exploration Bonuses//////////////
/* Notes
Gain experience when you reach a location or Event occurs
*/
/****Invovled Databases****/
DB_ExplorationZones((TRIGGER)_Location,(INTEGER)_Act,(INTEGER)_ActPArt,(INTEGER)_Gain);
DB_ExplorationEvents((STRING)_String,(INTEGER)_Act,(INTEGER)_ActPart,(INTEGER)_Gain);
/****Usefull Procedures****/
Proc_AddExplorationEvent((STRING)_String);
/* Define Keywords
(TRIGGER)_Location : Gain Exirence upon reaching location
(INTEGER)_Act : Always 1 (in Main game)
(INTEGER)_ActPart : Higher the later in game it is (not sure why)
(INTEGER)_Gain : Level of Reward (not exp)
*/
//////CIRDialog////////////
/* Notes
Something to do with charisma experience
*/
/****Invovled Databases****/
DB_CIRDialog((STRING)_Event, (INTERGER)_Act, (INTERGER)_ActPart, (INTERGER)_Gain);
/****Usefull Procedures****/
/* Define Keywords
(STRING)_Event : Global Event its triggered on
(INTERGER)_Act : Always 1 (in Main game)
(INTERGER)_ActPart : Higher the later in game it is (not sure why)
(INTERGER)_Gain : Reletive to Exp Gain? Main Game: 1-10
*/
/////Forbindden Areas///////////
/* Notes
Makes NPCs react when Player(s) go where they are not wanted
*/
/****Invovled Databases****/
DB_ForbiddenArea((STRING)_ID,(CHARACTER)_NPC);
DB_ForbiddenAreaTriggers((STRING)_ID,(TRIGGER)_Trigger,(TRIGGER)_Exit);
DB_ForbiddenDoors((STRING)_ID,(ITEM)_Door);
/****Usefull Procedures****/
ProcClearForbiddenArea((STRING)_ID);
/* Define Keywords
(STRING)_ID : ID of forbindden area
(CHARACTER)_NPC : Owner of forbindden area (There can be multiple per forbidden area)
(TRIGGER)_Trigger : Area of trespassing
(TRIGGER)_Exit : If kicked out of area end up at this trigger
(ITEM)_Door : Door that is considered trespassing if used
*/
[/php][/spoiler]
//------------------------Illegals-------------------------//
[spoiler][php]
/////Illegal Poop///////////
/* Notes
*/
/****Invovled Databases****/
NoStealingReaction(_Npc); //NPCs that just don't care if an item is stolen
/****Usefull Procedures****/
/* Define Keywords
*
[/php][/spoiler]
//------------------------Player Management-------------------------//
[spoiler][php]
/////SubRegion///////////
/* Notes
*/
/****Invovled Databases****/
DB_Subregion((TRIGGER)_Trigger,(STRING)_Message,(INTERGER)_ShowMarker);
DB_MarkerDB((STRING)_Marker);
/****Usefull Procedures****/
/* Define Keywords
(TRIGGER)_Trigger : When entering this trigger shows subRegion message
(STRING)_Message : label for message to be displayed
(INTERGER)_ShowMarker : bool, doesn't matter what goes here. Always Shows
(STRING)_Marker : ID for marker
*/
/////Journal & Discription///////////
/* Notes
ItemDisplayText is used with DB_Global_ItemDescriptions
UnlockJournalRecipe is used with DB_RecipeBook
*/
/****Invovled Databases****/
DB_Global_ItemDescriptions((ITEM)_item, (STRING)_description);
DB_RecipeBook((STRING)_Template, (STRING)_ID);
/****Usefull Procedures****/
/* Define Keywords
(ITEM)_item : Item to be descriped
(STRING)_description : description of that item
((STRING)_Template : template of an item
(STRING)_ID) : Journal unlock ID
*/
/////Tutorial Messages///////////
/* Notes
*/
/****Invovled Databases****/
DB_TutorialInfo((STRING)_Message,(INTEGER)_Key,(STRING)_Cat);
DB_TutPlayed((INTERGER)_ID,(STRING)_Message); //Used in checks for tutorial arleady played
/****Usefull Procedures****/
//PROC_CheckPlayTut((STRING)_Message); //Commented out because it was ment for 2 players (calls following procedure twice)
PROC_CheckPlayTut((CHARACTER)_Player,(STRING)_Message); //Use to play tutorial for a character
PROC_CheckPlayTutWithDelay((CHARACTER)_Player,(STRING)_Message,(INTEGER)_Delay);
/* Define Keywords
(INTERGER)_ID : Reserved Peer ID, aquire with query 'CharacterGetReservedPeerID((CHARACTER)_Player,(INTERGER)_ID)'
(STRING)_Message : Internal name of tutorial you show
(INTEGER)_Delay) : Delay before tutorial plays
*/
[/php][/spoiler]
//------------------------General-------------------------//
[spoiler][php]
/////Some Book keeping///////////
/* Notes
Some book keeping databases and procedures that are good to be aware of
Managed in AAA_FirstGoal
*/
/****Invovled Databases****/
DB_DialogPlayers((ITERGER)_DialogInst,(CHARACTER)_Player,(ITERGER)_Index); //Player in a dialog and their index number
DB_DialogNPCs((ITERGER)_DialogInst,(CHARACTER)_Player,(ITERGER)_Index); //NPC in a dialog and their index number
DB_DialogNumPlayers((ITERGER)_DialogInst,(ITERGER)_NumPlayers); //Number of players in a Dialog
DB_DialogNumNPCs((ITERGER)_DialogInst,(ITERGER)_NumNPCs); //Number of NPCs in a Dialog
DB_OtherPlayersSee((CHARACTER)_Npc); //Can another Player see this NPC
Sees((CHARACTER)_OtherPlayer,(CHARACTER)_Npc); //List of who sees who
DB_OtherPlayersInRegion((TRIGGER)_CheckTrigger,1); //Is there another player in the Trigger area
DB_PlayerTriggers((TRIGGER)_Trig); //Player triggers
InRegion((CHARACTER)_Npc, (STRING)_Region); //NPC is in Region
WasInRegion((CHARACTER)_Npc,(STRING)_Region); //NPC was in Region
Dead((CHARACTER)_Npc); //List of dead NPCs
CurrentLevel((STRING)_Region); //Current Level String
ObjectState((ITEM)_Object,(STRING)_State); //Objects and current state ("in the world", "unreachable", "in npc backpack")
OneShotPlayerTrigger((TRIGGER)_Trig); //List of unactivated one time triggers include companions
OneShotPlayerOnlyTrigger((TRIGGER)_Trig); //List of unactivated one time triggers for only players
Time((ITERGER)_Day,(ITERGER)_Hour,(ITERGER)_TotalHours); //Atmosphere has no reaction, i think
/****Usefull Procedures****/
ProcTriggerRegisterForPlayers((TRIGGER)_Trig); //cleanly register trigger for players and companions
ProcTriggerUnregisterForPlayers((TRIGGER)_Trig); //cleanly unregister trigger for players and companions
ProcRegisterForCompanions((TRIGGER)_Trig); //cleanly register trigger for companions only
ProcUnRegisterForCompanions((TRIGGER)_Trig); //cleanly unregister trigger for companions only
ProcRegisterPlayerTriggers((CHARACTER)_Char); //cleanly register character for triggers
ProcUnRegisterPlayerTriggers((CHARACTER)_Char); //cleanly unregister character for triggers
/* Define Keywords
*/
/////Autosave///////////
/* Notes
*/
/****Invovled Databases****/
DB_AutoSaveTrigger((TRIGGER)_Trigger);
/****Usefull Procedures****/
/* Define Keywords
(TRIGGER)_Trigger : Autosave at Trigger
*/
/////Counters///////////
/* Notes
I did a little cleaning, there was a random interger multiplication
*/
/****Invovled Databases****/
dbReflectionDialogs((STRING)_Type,(STRING)_Dialog);
dbTargetCounts((STRING)_Type,(INTERGER)_Target);
/****Usefull Procedures****/
ProcDeclareCounter((STRING)_Name);
ProcIncreaseCounter((TRIGGER)_Trigger[, (INTERGER)_Amount]);
/* Define Keywords
(STRING)_Type : Name of counter
(INTERGER)_Target : target quantity of envents
(STRING)_Dialog : name of dialog to be started when counter reaches its target
(INTERGER)_Amount : Increase counter by amount (default to 1)
*/
/////Kill Counters///////////
/* Notes
*/
/****Invovled Databases****/
KillCounterCounts((STRING)_Name, (INTERGER)_Count);
KillCounter((STRING)_CounterDB,(INTEGER)_TargetCount);
/****Usefull Procedures****/
/* Define Keywords
*/
/////Object Timers///////////
/* Notes
These are a bit funky, they use Database entries as events that pass objects
*/
/****Invovled Databases****/
ItemTimerFinished((ITEM)_Item,(STRING)_TimerName)
CharTimerFinished((CHARACTER)_Character,(STRING)_TimerName);
//Use as an event that passes an object ex:"IF ItemTimerFinished(_Item, (STRING)_TimerName) THEN" ex:CYS_Church_Door, KB(76)
/****Usefull Procedures****/
ItemTimer((ITEM)_Item,(STRING)_TimerName,(INTEGER)_Time);
ItemTimerCancel((ITEM)_Item,(STRING)_TimerName);
CharTimer((CHARACTER)_Character,(STRING)_TimerName,(INTEGER)_Time);
CharTimerCancel((CHARACTER)_Character,(STRING)_TimerName);
/* Define Keywords
(STRING)_TimerName : ID of timer
(INTEGER)_Time : Length of timer (ms)
(ITEM)_Item : Item passed into and out of Timer Finished Database
(CHARACTER)_Character : Character passed into and out of Timer Finished Database
*/
//////////////// Created by Zolton ///////////////////////////////////////
[/php]
[/spoiler]
My eventual goal is to provide a boiled down version of the main game story script that has all the general tools and none of the main game content. Along with the full description of said tools. Allowing for standalone mods that don't have to be in the main game module.
This is still a work in progress with a lot of tools to discover.
If you want to help please test that this stuff, give improved descriptions, above all inform me of any mistakes!
This is what i got so far
////////////// TABLE OF CONTENTS ////////
[spoiler]
ZOLTON'S DIVINITY ENGINE STORY EDITOR TOOLS
Version 0.3.0
---Characters
Moves Character
COMBAT
---Dialogs
Dialogs
Dialog 2
One Shot Dialog
Player Comments
Party Dialog
Warning Dialogs
---NPCs
Shop Owners
Companions and Henchmen
Food For Animals
Relations
Attitude
Persuasion
---Items
Doors
Hidden Walls
Shoveling Stuff
---Areas
CIRDialog
Exploration Bonuses
Forbindden Areas
---Illegal
Illegal Poop
---Player Management
SubRegion
Journal & Discription
Tutorial Messages
---General
Some Book keeping
Autosave
Counters
Kill Counters
Object Timers
[/spoiler]
//------------------------Characters-------------------------//
[spoiler]
[php]
/////Moves Character///////////
/* Notes
This Section is about moving a Character from one point to another, keeping and restoring their normal behaviors
They will also Stop if attacked and resume when they leave combat. Upon death the events and databases will be cleaned up
Nice work Larin
*/
/****Invovled Databases****/
/****Usefull Procedures****/
ProcCharacterMoveToTrigger((CHARACTER)_Char,(TRIGGER)_Point,(INTEGER)_Running,(STRING)_Event);
ProcCharacterMoveToItem((CHARACTER)_Char,(ITEM)_Point,(INTEGER)_Running,(STRING)_Event);
/* Define Keywords
(CHARACTER)_Char : Move this Character
(TRIGGER)_Point : Move to this Trigger
(ITEM)_Point : Move to this item
(INTEGER)_Running : is running? 0->False 1->True
(STRING)_Event : I believe event upon completion (goes into CharacterMoveToTrigger())
*/
/////COMBAT///////////
/* Notes
Combat is generated by background scripts
*/
/****Invovled Databases****/
dbCombat((CHARACTER)_Character,(INTERGER)_ID); //Generated
//database containing all characters currently in combat, Useful as a check for if a characcher is in combat ex: NOT dbCombat(_Character,_ID)
/****Usefull Procedures****/
/* Define Keywords
(CHARACTER)_Character : Character in combat (generated)
(INTERGER)_ID : Combat interger ID (generated)
*/
[/php][/spoiler]
//------------------------Dialogs-------------------------//
[spoiler][php]
//////Dialogs/////////////
/* Notes
Thi part sets up dialogs when you click on the global character
*/
/****Invovled Databases****/
//main way of adding dialog to global units
DB_Dialogs((CHARACTER)_Npc,[(CHARACTER)_Npc2,(CHARACTER)_Npc3,(CHARACTER)_Npc4,](STRING)_Dialog);
DB_AD_Dialog((CHARACTER)_Character,(STRING)_Dialog);
/****Usefull Procedures****/
ProcRemoveDialogEntryForSpeaker((CHARACTER)_NPC,(STRING)_Dialog);
ProcRemoveAllDialogEntriesForSpeaker((CHARACTER)_NPC);
DB_ItemGivesDualDialog((ITEM)_Item,(STRING)_Dialog);
ProcRemoveNPCADs((CHARACTER)_Npc); //Removes all Automatic dialogs
//used Once in main game, adding items to DB_Dialogs should work
ClearDefaultDialog((CHARACTER)_Npc);
SetDefaultDialog((CHARACTER)_Npc,(STRING)_Dialog,(INTEGER)_CloseButtonEnabled);
/* Define Keywords
*/
/////////Dialog 2/////////////
/* Notes
This type of dialog deals with triggered dialogs, use them in procedures
threaten means you have a weapon out
*/
/****Invovled Databases****/
DB_CustomThreatenDialog((CHARACTER)_Npc,(STRING)_Dialog);
DB_CustomThreatenGroupDialog((STRING)_Group,(STRING)_Dialog);
DB_CustomCompanionGroupDialog(_Group,_Dialog);
DoStartDialog((CHARACTER)_Player, (INTEGER)_Mode);
DB_CustomCompanionDialog((CHARACTER)_Npc,(STRING)_Dialog);
SetDefaultThreatenedDialog((CHARACTER)_Npc,(STRING)_Dialog);
/****Usefull Procedures****/
SetAndStartDialog((CHARACTER)_Player,(CHARACTER)_Npc,(STRING)_Dialog[,(INTEGER)_EnableCloseButton]); //Starts a dialog reatively safe
DoStartDialog((CHARACTER)_Player,(CHARACTER)_Npc,(STRING)_Dialog); //Used by NPC_Actions, no dialog buffer unlike SetAndStartDialog
ProcStartCompanionDialog((CHARACTER)_Player,(CHARACTER)_Npc); //This one just has an extra tutorial as far as I can tell, can do custom or default
/* Define Keywords
(CHARACTER)_Player :
(CHARACTER)_Npc :
(STRING)_Dialog :
(INTEGER)_EnableCloseButton : Default to 1
*/
/*****Dialog Events******/
/**Put away weapons during dialog
Character Event Set :"EVENT_npc_player_puts_down_weapons_for"
***NPC Attacks after Dialog
Character Event Set :"EVENT_npc_player_attacks"
*/
/*****Stored Data*****/
TalkedToPlayer(_Player,_Npc); //Remembers if you talked to an NPC
RanDialog(_Player,_Dialog); //Remembers if you ran a dialog
/*********Special*********/
//If you used DoStartDialog you can preload an event for the upcoming conversation by adding another definition of the PreStartDialog Procedure
/* Simple Example
PROC
PreStartDialog((CHARACTER)_Player,(CHARACTER)_Npc,"MyDialogName")
//AND Conditions
THEN
SetAndRememberDialogEvent(_Player,"MyEventName",0);
*/
/////One Shot Dialog///////////
/* Notes
Basicly all the dialogs that only happen once, luckly larin named these relatively well.
There are brackets around certain databases you don't nessassarily need (you can have that many NPCs conversing, might be a problem with having 4).
*/
/****Invovled Databases****/
OneShotPlayerOnlyTrigger((TRIGGER)_Trigger);
DB_OneShot_PlayerOnlyDialogTrigger((TRIGGER)_Trigger,(STRING)_Dialog,(CHARACTER)_NPC);
DB_OneShot_DialogTrigger((TRIGGER)_Trigger, (STRING)_Dialog,(CHARACTER)_NPC [, (CHARACTER)_NPC2, (CHARACTER)_NPC3, (CHARACTER)_NPC4]);
DB_OneShot_DialogItem((ITEM)_Item, (STRING)_Dialog [, (CHARACTER)_NPC, (CHARACTER)_NPC2, (CHARACTER)_NPC3, (CHARACTER)_NPC4]); //happens upon use of item
DB_OneShot_ADTrigger((TRIGGER)_Trigger,(STRING)_Dialog,(CHARACTER)_NPC[,(CHARACTER)_NPC2]); //not sure differncebetween this and DB_OneShot_DialogTrigger
/****Usefull Procedures****/
/* Define Keywords
(TRIGGER)_Trigger : Dialog occurs at this trigger
(STRING)_Dialog :
(CHARACTER)_NPC(s) : NPC included in dialog
*/
/////Player Comments////////////////
/* Notes
If you want A Player Character to make a comment about somthing
May Require 2 players
*/
/****Invovled Databases****/
DB_PlayerComments((STRING)_Comment, (STRING)_Text, (INTERGER)_PlayerAmount, (INTERGER)_Current);
DB_PlayerComment_Trigger((TRIGGER)_Location,(STRING)_Comment);
DB_PlayerComment_Event((STRING)_Event, (STRING)_Comment); //Not used in main game
PROC_CompanionComment((STRING)_ID, (CHARACTER)_Companion); //Non-Larin
/****Usefull Procedures****/
Launch_PlayerComment((CHARACTER)_Player,(STRING)_Comment);
/* Define Keywords
(STRING)_Comment : Unique ID for each comment
(STRING)_Text : Text Displayed
(CHARACTER)_Player : The player that makes the comment
(INTERGER)_PlayerAmount : Ammount of players required to be present
(INTERGER)_Current : On current comment
(CHARACTER)_Companion : Campanion That comments
*/
/////Party Dialog///////////
/* Notes
*/
/****Invovled Databases****/
DB_KillCounterGivesPartyDialog((STRING)_Name, (INTEGER)_Count, (STRING)_Dialog);
DB_ItemGivesPartyDialog((ITEM)_Item,(STRING)_Dialog);
DB_EventGivesPartyDialog((STRING)_Event,(STRING)_Dialog);
DB_TriggerGivesPartyDialog((TRIGGER)_Trigger,(STRING)_Dialog);
DB_CharacterEventGivesPartyDialog((CHARACTER)_Character,(STRING)_Event,(STRING)_Dialog);
/****Usefull Procedures****/
ProcDefinePartyDialog((STRING)_Dialog); //Used in Infected Dog Mission, and more...
ProcCancelPartyDialog((STRING)_Dialog); //Cancel Specific party dialog
ProcCancelDualDialogs(); //Cancels all party dialogs
/* Define Keywords
(STRING)_Dialog : Active Party Dialog ID
(INTEGER)_Count : Count target for kill counter
(ITEM)_Item : Item that upon use gives party dialog
(STRING)_Event : Global Event that gives party dialog
(TRIGGER)_Trigger : Trigger that upon trip gives party dialog (one time)
*/
/////Warning Dialogs///////////
/* Notes
Combat Warnings are entering combat shoutouts if the player is already in combat
Warnings are dialogs
If the player attacks someone they get a couple chances before they DoRevengeOnAttack
EvilDude : 0
Companion: 3
Good standing (>=0 attitude) : 3
Bad Standing (<0 attitude) : 2
*/
/****Invovled Databases****/
dbCustomCombatWarningDialog((STRING)_Faction,_Dialog); //If player is in comabt and is joined by NPC
DB_CustomWarningDialog(_Npc,(STRING)_Dialog); //For NPC player interaction upon illegal activity, overrides faction dialogs
DB_CustomFactionWarningDialog(_Faction,(STRING)_Dialog); //For NPC player interaction upon illegal activity, overrides group dialogs
DB_CustomGroupWarningDialog(_Group,_Dialog); //For NPC player interaction upon illegal activity, overrides default dialog
/****Usefull Procedures****/
/******Default Dialogs******/
//Default combat warning Dialog: "please_dont_attack_combat"
//Default Warning Dialog: "please_dont_attack"
/* Define Keywords
*
[/php][/spoiler]
//------------------------NPCs-------------------------//
[spoiler][php]
/////Shop Owners///////////
/* Notes
This sets up standard warnings and threatened message for shopkeepers
*/
/****Invovled Databases****/
ShopRegion((STRING)_Level,(TRIGGER)_Region,(CHARACTER)_ShopKeeper,(STRING)_?);
ItemOwnerShipTriggers((STRING)_Level,(TRIGGER)_Region,(CHARACTER)_ShopKeeper)
/****Usefull Procedures****/
/* Define Keywords
(STRING)_Level : Name of level shop is on (ex:"Cyseal")
(TRIGGER)_Region : Trigger region of Shop
(CHARACTER)_ShopKeeper : Shopkepper
(STRING)_? : Unused
*/
/////Companions and Henchmen///////////
/* Notes
*/
/****Invovled Databases****/
DB_AttackDialog(_companion, _dialog); //custom dialog for when limit reached of being attacked
DB_HenchmanPool((CHARACTER)_Char);
/****Usefull Procedures****/
/******Default Dialogs******/
//Dialog if a henchmen leaves the party: "Henchman_LeavesParty" on attack
/* Define Keywords
*
/////Food For Animals///////////
/* Notes
Found this and I don't think it's used in the main game
I'm pretty sure its linked to animal charScripts
*/
/****Invovled Databases****/
DB_AnimalFoodVars((STRING)_Var);
/****Usefull Procedures****/
ProcSetAnimalFoodEvents((CHARACTER)_Player,(CHARACTER)_Npc);
ProcGiveAnimalFood((CHARACTER)_Player,(CHARACTER)_Npc);
/* Define Keywords
*/
/////Relations///////////
/* Notes
*/
/****Invovled Databases****/
/****Usefull Procedures****/
SetRelationFactionToPlayers((STRING)_Faction,(INTEGER)_Relation);
SetRelationIndivFactionToPlayers((CHARACTER)_char,(INTEGER)_Relation);
ProcSetRelationToPlayers((CHARACTER)_Character,(INTEGER)_Relation);
ChangeAttitude((CHARACTER)_NPC,(CHARACTER)_Player,(INTEGER)_Value);
/* Define Keywords
*/
/////Attitude///////////
/* Notes
If you attack someone that the player has greater or equal to then 25 reputation towards you, they will start warning dialog
If you attack a pet and the owner can see you they will start "Default_AttackPet" Dialog with you become hostile and try to call the gaurds in the region
*/
/****Invovled Databases****/
IsNotMessingAround(_Npc) //Won't stop and chat if you attack them
EvilDude(_Npc) //Disabled reputation's effects on character
WarningDialog(_Npc,_Dialog); //Custom Warning Dialog for NPC
/****Usefull Procedures****/
SetAttitudeToAtLeast((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_MinAtt);
SetAttitudeToAtMax((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_MaxAtt);
SetRepAttitudeToAtLeast((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_MinRepAtt);
DecreaseAttitude((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_Delta);
IncreaseAttitude((CHARACTER)_Player,(CHARACTER)_Npc,(INTEGER)_Delta);
SetHostileAtt((CHARACTER)_Npc,(INTEGER)_Att); //NPC becomes hostile when at at or below the HostileAtt, becomes unhostile when above. Not used in Game
/*****Character Events*****/
//Dialog Character Event "EVENT_npc_attitude_up" increases attitude of players in dialog by 10
//Dialog Character Event "EVENT_npc_attitude_down" decreases attitude of players in dialog by 10
//Dialog Character Event "EVENT_npc_attitude_up_25" increases attitude of players in dialog by 25
//Dialog Character Event "EVENT_npc_attitude_down_25" decreases attitude of players in dialog by 25
//Dialog Character Event "EVENT_npc_attitude_up_50" increases attitude of players in dialog by 50
//Dialog Character Event "EVENT_npc_attitude_down_50" decreases attitude of players in dialog by 50
/* Define Keywords
*
/////Persuasion///////////
/* Notes
This section creates the persuasion possiblities. The standard are Intimidate, Charm, and Logic.
I am unsure I you can add more options to this list, one would need to look at a couple calls
All the information boils down into StartDialogConflict call.
It aquires information from the ability information from CharacterGetAbility query
Network? - kinda confused on this one
if a "Set_Persuasion_Flags" is set in a dialog and one or both player characters have higher then 10 perception,
it will call DialogSetNodeFlag (?) and flag it something in Dialog.
This all exist in the file _Glo_IntimidateCharmLogic
*/
/****Invovled Databases****/
dbDialogPersuasionEvents((STRING)_Event,(STRING)_LocalEvent,(STRING)_Text);
dbDialogPersuasionNodes((INTERGER)_?, (STRING)_?);
/****Usefull Procedures****/
/* Define Keywords
(STRING)_Event : Name of persusion event (ex: "ApplyReason", or "ApplyIntimidate") can be anything vent named here
(STRING)_LocalEvent : Name of event localy (ex: "Reason", or "Charm") can be anything vent named here
(STRING)_Text : Name of String to be shown
*/
[/php][/spoiler]
//------------------------Items-------------------------//
[spoiler][php]
/////Doors///////////
/* Notes
*/
/****Invovled Databases****/
/****Usefull Procedures****/
ItemCloseAndLock((ITEM)_Item,(STRING)_Key);
ItemUnlockAndOpen((ITEM)_Item);
/* Define Keywords
*/
/////Hidden Walls///////////
/* Notes
To create a hidden wall and the wway to open it one must run the procedure PROC_RegisterHiddenWall on the wall
you can then create your own Procedure to then assign a way to open it. An example is provided
*/
/****Invovled Databases****/
HiddenWallDB((INTEGER)_WallIndex, (ITEM)_Wall); //Generated by PROC_RegisterHiddenWall
HiddenWallItemDB((ITEM)_Item, (INTEGER)_WallIndex);
//PROC_CommentHiddenEffect is a procedure that occurs when a HiddenWallItemDB is used and plays one of 4 lines, I have disabled it
HiddenWallEventDB((STRING)_flag, (INTEGER)_wallIndex);
HiddenWallTriggerDB((TRIGGER)_Trigger, (INTEGER)_wallIndex); //Opens wall when someone is in the trigger area, closes up when no one is :)
/****Usefull Procedures****/
PROC_RegisterHiddenWall((ITEM)_Wall);
/****Special****/
//Item Event "Open" on a hidden wall will open the wall
/*
PROC PROC_RegisterWaysToOpenHiddenWall()
AND HiddenWallDB(_WallIndex, (ITEM)_Wall)
THEN
HiddenWallItemDB((ITEM)_Item,_WallIndex);
*/
/* Define Keywords
(INTEGER)_WallIndex : generated number
(ITEM)_Wall : The hidden wall to be opened
(ITEM)_Item : Item upon usage opens wall
(TRIGGER)_Trigger : Trigger Zone to activate wall
(STRING)_flag : Global flag that upon set opens wall
*/
///////Shoveling Stuff/////////////
/* Notes
Script for shoveling
If its in the database the reward(s) spawn upon completing the dig
*/
/****Invovled Databases****/
DB_ShovelArea((TRIGGER)_Area, (STRING)_Reward, (ITEM)_Dirt);
DB_ShovelRewardComment((STRING)_Reward, (STRING)_Comment); //Test with Test_Greever
DB_ShovelRewardItemAppear((STRING)_Reward, (ITEM)_Item,(TRIGGER)_Spawn);
DB_ShovelRewardItemAdd((STRING)_Reward, (ITEM)_Item);
DB_ShovelRewardCharacterAppear((STRING)_Reward,(CHARACTER)_Character);
DB_ShovelRewardItemSpawn((STRING)_Reward,(ITEM)_Item);
DB_ShovelRewardItemTemplate((STRING)_Reward,(STRING)_ItemTemplate,(INTEGER)_Amount);
DB_ShovelRewardEvent((STRING)_Reward,(STRING)_Event);
DB_ShovelRewardSurface((STRING)_Reward,(TRIGGER)_Trigger, (STRING)_Type, (REAL)_Radius);
/****Usefull Procedures****/
/* Define Keywords
(TRIGGER)_Area : Player must be in this trigger area
(ITEM)_Dirt : The dirt mount that appears at end of dig
(STRING)_Reward : Name of Reward
(ITEM)_Item : Item given upon completion
(TRIGGER)_Spawn) : Reward is moved to this trigger
*/
[/php][/spoiler]
//------------------------Areas-------------------------//
[spoiler][php]
/////Exploration Bonuses//////////////
/* Notes
Gain experience when you reach a location or Event occurs
*/
/****Invovled Databases****/
DB_ExplorationZones((TRIGGER)_Location,(INTEGER)_Act,(INTEGER)_ActPArt,(INTEGER)_Gain);
DB_ExplorationEvents((STRING)_String,(INTEGER)_Act,(INTEGER)_ActPart,(INTEGER)_Gain);
/****Usefull Procedures****/
Proc_AddExplorationEvent((STRING)_String);
/* Define Keywords
(TRIGGER)_Location : Gain Exirence upon reaching location
(INTEGER)_Act : Always 1 (in Main game)
(INTEGER)_ActPart : Higher the later in game it is (not sure why)
(INTEGER)_Gain : Level of Reward (not exp)
*/
//////CIRDialog////////////
/* Notes
Something to do with charisma experience
*/
/****Invovled Databases****/
DB_CIRDialog((STRING)_Event, (INTERGER)_Act, (INTERGER)_ActPart, (INTERGER)_Gain);
/****Usefull Procedures****/
/* Define Keywords
(STRING)_Event : Global Event its triggered on
(INTERGER)_Act : Always 1 (in Main game)
(INTERGER)_ActPart : Higher the later in game it is (not sure why)
(INTERGER)_Gain : Reletive to Exp Gain? Main Game: 1-10
*/
/////Forbindden Areas///////////
/* Notes
Makes NPCs react when Player(s) go where they are not wanted
*/
/****Invovled Databases****/
DB_ForbiddenArea((STRING)_ID,(CHARACTER)_NPC);
DB_ForbiddenAreaTriggers((STRING)_ID,(TRIGGER)_Trigger,(TRIGGER)_Exit);
DB_ForbiddenDoors((STRING)_ID,(ITEM)_Door);
/****Usefull Procedures****/
ProcClearForbiddenArea((STRING)_ID);
/* Define Keywords
(STRING)_ID : ID of forbindden area
(CHARACTER)_NPC : Owner of forbindden area (There can be multiple per forbidden area)
(TRIGGER)_Trigger : Area of trespassing
(TRIGGER)_Exit : If kicked out of area end up at this trigger
(ITEM)_Door : Door that is considered trespassing if used
*/
[/php][/spoiler]
//------------------------Illegals-------------------------//
[spoiler][php]
/////Illegal Poop///////////
/* Notes
*/
/****Invovled Databases****/
NoStealingReaction(_Npc); //NPCs that just don't care if an item is stolen
/****Usefull Procedures****/
/* Define Keywords
*
[/php][/spoiler]
//------------------------Player Management-------------------------//
[spoiler][php]
/////SubRegion///////////
/* Notes
*/
/****Invovled Databases****/
DB_Subregion((TRIGGER)_Trigger,(STRING)_Message,(INTERGER)_ShowMarker);
DB_MarkerDB((STRING)_Marker);
/****Usefull Procedures****/
/* Define Keywords
(TRIGGER)_Trigger : When entering this trigger shows subRegion message
(STRING)_Message : label for message to be displayed
(INTERGER)_ShowMarker : bool, doesn't matter what goes here. Always Shows
(STRING)_Marker : ID for marker
*/
/////Journal & Discription///////////
/* Notes
ItemDisplayText is used with DB_Global_ItemDescriptions
UnlockJournalRecipe is used with DB_RecipeBook
*/
/****Invovled Databases****/
DB_Global_ItemDescriptions((ITEM)_item, (STRING)_description);
DB_RecipeBook((STRING)_Template, (STRING)_ID);
/****Usefull Procedures****/
/* Define Keywords
(ITEM)_item : Item to be descriped
(STRING)_description : description of that item
((STRING)_Template : template of an item
(STRING)_ID) : Journal unlock ID
*/
/////Tutorial Messages///////////
/* Notes
*/
/****Invovled Databases****/
DB_TutorialInfo((STRING)_Message,(INTEGER)_Key,(STRING)_Cat);
DB_TutPlayed((INTERGER)_ID,(STRING)_Message); //Used in checks for tutorial arleady played
/****Usefull Procedures****/
//PROC_CheckPlayTut((STRING)_Message); //Commented out because it was ment for 2 players (calls following procedure twice)
PROC_CheckPlayTut((CHARACTER)_Player,(STRING)_Message); //Use to play tutorial for a character
PROC_CheckPlayTutWithDelay((CHARACTER)_Player,(STRING)_Message,(INTEGER)_Delay);
/* Define Keywords
(INTERGER)_ID : Reserved Peer ID, aquire with query 'CharacterGetReservedPeerID((CHARACTER)_Player,(INTERGER)_ID)'
(STRING)_Message : Internal name of tutorial you show
(INTEGER)_Delay) : Delay before tutorial plays
*/
[/php][/spoiler]
//------------------------General-------------------------//
[spoiler][php]
/////Some Book keeping///////////
/* Notes
Some book keeping databases and procedures that are good to be aware of
Managed in AAA_FirstGoal
*/
/****Invovled Databases****/
DB_DialogPlayers((ITERGER)_DialogInst,(CHARACTER)_Player,(ITERGER)_Index); //Player in a dialog and their index number
DB_DialogNPCs((ITERGER)_DialogInst,(CHARACTER)_Player,(ITERGER)_Index); //NPC in a dialog and their index number
DB_DialogNumPlayers((ITERGER)_DialogInst,(ITERGER)_NumPlayers); //Number of players in a Dialog
DB_DialogNumNPCs((ITERGER)_DialogInst,(ITERGER)_NumNPCs); //Number of NPCs in a Dialog
DB_OtherPlayersSee((CHARACTER)_Npc); //Can another Player see this NPC
Sees((CHARACTER)_OtherPlayer,(CHARACTER)_Npc); //List of who sees who
DB_OtherPlayersInRegion((TRIGGER)_CheckTrigger,1); //Is there another player in the Trigger area
DB_PlayerTriggers((TRIGGER)_Trig); //Player triggers
InRegion((CHARACTER)_Npc, (STRING)_Region); //NPC is in Region
WasInRegion((CHARACTER)_Npc,(STRING)_Region); //NPC was in Region
Dead((CHARACTER)_Npc); //List of dead NPCs
CurrentLevel((STRING)_Region); //Current Level String
ObjectState((ITEM)_Object,(STRING)_State); //Objects and current state ("in the world", "unreachable", "in npc backpack")
OneShotPlayerTrigger((TRIGGER)_Trig); //List of unactivated one time triggers include companions
OneShotPlayerOnlyTrigger((TRIGGER)_Trig); //List of unactivated one time triggers for only players
Time((ITERGER)_Day,(ITERGER)_Hour,(ITERGER)_TotalHours); //Atmosphere has no reaction, i think
/****Usefull Procedures****/
ProcTriggerRegisterForPlayers((TRIGGER)_Trig); //cleanly register trigger for players and companions
ProcTriggerUnregisterForPlayers((TRIGGER)_Trig); //cleanly unregister trigger for players and companions
ProcRegisterForCompanions((TRIGGER)_Trig); //cleanly register trigger for companions only
ProcUnRegisterForCompanions((TRIGGER)_Trig); //cleanly unregister trigger for companions only
ProcRegisterPlayerTriggers((CHARACTER)_Char); //cleanly register character for triggers
ProcUnRegisterPlayerTriggers((CHARACTER)_Char); //cleanly unregister character for triggers
/* Define Keywords
*/
/////Autosave///////////
/* Notes
*/
/****Invovled Databases****/
DB_AutoSaveTrigger((TRIGGER)_Trigger);
/****Usefull Procedures****/
/* Define Keywords
(TRIGGER)_Trigger : Autosave at Trigger
*/
/////Counters///////////
/* Notes
I did a little cleaning, there was a random interger multiplication
*/
/****Invovled Databases****/
dbReflectionDialogs((STRING)_Type,(STRING)_Dialog);
dbTargetCounts((STRING)_Type,(INTERGER)_Target);
/****Usefull Procedures****/
ProcDeclareCounter((STRING)_Name);
ProcIncreaseCounter((TRIGGER)_Trigger[, (INTERGER)_Amount]);
/* Define Keywords
(STRING)_Type : Name of counter
(INTERGER)_Target : target quantity of envents
(STRING)_Dialog : name of dialog to be started when counter reaches its target
(INTERGER)_Amount : Increase counter by amount (default to 1)
*/
/////Kill Counters///////////
/* Notes
*/
/****Invovled Databases****/
KillCounterCounts((STRING)_Name, (INTERGER)_Count);
KillCounter((STRING)_CounterDB,(INTEGER)_TargetCount);
/****Usefull Procedures****/
/* Define Keywords
*/
/////Object Timers///////////
/* Notes
These are a bit funky, they use Database entries as events that pass objects
*/
/****Invovled Databases****/
ItemTimerFinished((ITEM)_Item,(STRING)_TimerName)
CharTimerFinished((CHARACTER)_Character,(STRING)_TimerName);
//Use as an event that passes an object ex:"IF ItemTimerFinished(_Item, (STRING)_TimerName) THEN" ex:CYS_Church_Door, KB(76)
/****Usefull Procedures****/
ItemTimer((ITEM)_Item,(STRING)_TimerName,(INTEGER)_Time);
ItemTimerCancel((ITEM)_Item,(STRING)_TimerName);
CharTimer((CHARACTER)_Character,(STRING)_TimerName,(INTEGER)_Time);
CharTimerCancel((CHARACTER)_Character,(STRING)_TimerName);
/* Define Keywords
(STRING)_TimerName : ID of timer
(INTEGER)_Time : Length of timer (ms)
(ITEM)_Item : Item passed into and out of Timer Finished Database
(CHARACTER)_Character : Character passed into and out of Timer Finished Database
*/
//////////////// Created by Zolton ///////////////////////////////////////
[/php]
[/spoiler]
My eventual goal is to provide a boiled down version of the main game story script that has all the general tools and none of the main game content. Along with the full description of said tools. Allowing for standalone mods that don't have to be in the main game module.
This is still a work in progress with a lot of tools to discover.
If you want to help please test that this stuff, give improved descriptions, above all inform me of any mistakes!