BG1 coding tutorial
#16
Posted 01 June 2008 - 03:10 PM
I have another question. What means "parchment" in LeaveAreaLUA (S:Area*,S:Parchment*,P:Point*,I:Face*)? In mods suitable for both pure BG1 and BGT/TUTU parchment is used for BG1 Version but not in BGT/TUTU. Maybe it schould be added to this tutorial, but what is importance of that?
#17
Posted 02 June 2008 - 05:07 PM
Zed Nocear, on Jun 1 2008, 07:10 PM, said:
No idea what "parchment" means. Anyone?
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon
#19
Posted 19 June 2008 - 10:25 AM
Further, there have been findings that ADD_GAM_NPC is not a good idea to use at all:
ADD_GAM_NPC and uninstallation, non-functionality of .
So it seems that ADD_GAM_NPC, since it changes save-games, screws up the whole BG1 game, if the mod gets installed more than once. Since it is possible that a mod gets installed and deinstalled in one game installation (e.g. if the player decides to change the order of mods), this would lead to a malfunctioning NPC-creation (multiple times) if coded using ADD_GAM_NPC. Thank you Miloch and Red Carnelian for pointing this out!
I'll add the link and a comment in the tutorial that ADD_GAM_NPC is not recommended.
EDIT: Tutorial is updated concerning 107 MoveToOffset(P:Offset*) and ADD_GAM_NPC.
Edited by jastey, 19 June 2008 - 10:52 AM.
#20
Posted 27 October 2008 - 05:13 PM
[quote name='jastey' post='118548' date='Mar 30 2008, 04:47 AM'][size=10][u]BG1 coding tutorial[/u] [/size]
... [u]Post-dialogue of joinable NPCs[/u]
In BG1, the engine does not switch automatically from the joined dialogue "...J.dlg" to the post dialogue "...P.dlg" upon kickout. The kickout dialogue state is contained in the joined dialogue. Upon kickout, the post-dialogue has to be set via ~SetDialog("mynpcP")~. Upon joining, the dialogue is triggered via the post dialogue and the dialogue file is changed to the joined dialogue like in BGII.
An example: Ajantis' kickout dialogue is in his AJANTJ.dlg:
I'd like to modify the kick-out dialogs of the 25 Bioware NPCs for the next BG1 Tweaks. When they leave, they stay where they were kicked out. Is it possible to get the same result by modifying the *j.dlg files? Is it possible to add two responses to their leaving comments, one to "remain here" and another to "meet us at..."?
My concern is two-fold: My ignorance of dialog coding, and I don't want to screw up the Ajantis, Xan or any other NPC mod dialogs since Tweaks get installed last...
And all the time, such is the tragi-comedy of our situation, we continue to clamour for those very qualities we are rendering impossible. . . . In a sort of ghastly simplicity we remove the organ and demand the function. We make men without chests and expect of them virtue and enterprise. We laugh at honour and are shocked to find traitors in our midst. We castrate and bid the geldings be fruitful.
C.S. Lewis, The Abolition of Man
#21
Posted 19 December 2008 - 08:10 PM
IF ~~ THEN DO ~RunAwayFromNoInterrupt([PC],2)
LeaveAreaLUA("AR3304","",dmwwbereloc,0)~
However, to be able to limit it at the Gnoll Stronghold, Ice Island and the lower levels of Durlag's Tower, I've attempted to use this emulator.I've run into a problem. I've used the code from both this thread and from the Ajantis Friendship mod. It fails. Here is the relevant portion of the Debug file:
Quote
[./override/AR0002.ARE] loaded, 1472 bytes
[./override/MASTAREA.2DA] loaded, 1353 bytes
[./override/MASTAREA.2DA] loaded, 1353 bytes
Copying and patching 1 file ...
ERROR: error loading [newtweaks/baf/Z!EmulAreaCheck.BAF]
Stopping installation because of error.
Stopping installation because of error.
ERROR: [AR0002.ARE] -> [override/AR0002.ARE] Patching Failed (COPY) (Unix.Unix_error(20, "stat", "newtweaks/baf/Z!EmulAreaCheck.BAF"))
Stopping installation because of error.
ERROR Installing [NPCs go to inns], rolling back to previous state
[NewTweaks/backup/0/UNSETSTR.0] SET_STRING uninstall info not found
Will uninstall 439 files for [NEWTWEAKS/SETUP-NEWTWEAKS.TP2] component 0.
!Global("Z!EmulAreaCheck","GLOBAL","AR5100")?
And all the time, such is the tragi-comedy of our situation, we continue to clamour for those very qualities we are rendering impossible. . . . In a sort of ghastly simplicity we remove the organ and demand the function. We make men without chests and expect of them virtue and enterprise. We laugh at honour and are shocked to find traitors in our midst. We castrate and bid the geldings be fruitful.
C.S. Lewis, The Abolition of Man
#22
Posted 20 December 2008 - 12:08 AM
grogerson, on Dec 20 2008, 05:10 AM, said:
!Global("Z!EmulAreaCheck","GLOBAL","AR5100")?Quote
For simulating AreaCheck(), the variable "Z!EmulAreaCheck" can be used: For the original BG areas, the value of the variable is equal to the "ARxxxx" number. For (mod) areas that are not named like the standard "ARxxxx", the variable is equal to "0".
For example, now the Area AR2600 can be detected via the trigger "Global("Z!EmulAreaCheck","GLOBAL",2600)".
I am not sure why there is your error message, did you check the path names etc.? It doesn't seem to find "newtweaks/baf/Z!EmulAreaCheck.BAF" in this path.
#23
Posted 21 December 2008 - 06:24 PM
Strange as it seems, I can't get that error to go away, even though "newtweaks/baf/Z!EmulAreaCheck.BAF" is properly pointed to. To make matters worse, I've another tweak I'm working on using this emulation, and it works with no trouble. I even copied the working code over with no effect. The only difference is the non-working is vanilla BG1, the working is with TotSC...
And all the time, such is the tragi-comedy of our situation, we continue to clamour for those very qualities we are rendering impossible. . . . In a sort of ghastly simplicity we remove the organ and demand the function. We make men without chests and expect of them virtue and enterprise. We laugh at honour and are shocked to find traitors in our midst. We castrate and bid the geldings be fruitful.
C.S. Lewis, The Abolition of Man
#24
Posted 21 December 2008 - 08:02 PM
grogerson, on Dec 21 2008, 06:24 PM, said:
Strange as it seems, I can't get that error to go away, even though "newtweaks/baf/Z!EmulAreaCheck.BAF" is properly pointed to. To make matters worse, I've another tweak I'm working on using this emulation, and it works with no trouble. I even copied the working code over with no effect. The only difference is the non-working is vanilla BG1, the working is with TotSC...
#25
Posted 22 December 2008 - 02:16 AM
Mike1072, on Dec 22 2008, 05:02 AM, said:
#26
Posted 22 December 2008 - 06:42 PM
And all the time, such is the tragi-comedy of our situation, we continue to clamour for those very qualities we are rendering impossible. . . . In a sort of ghastly simplicity we remove the organ and demand the function. We make men without chests and expect of them virtue and enterprise. We laugh at honour and are shocked to find traitors in our midst. We castrate and bid the geldings be fruitful.
C.S. Lewis, The Abolition of Man
#27
Posted 23 December 2008 - 06:42 PM
From the DEBUG file:
Quote
Copied [NewTweaks/dlg/depart.d] to [override/dw#ajant.d]
Compiling 1 dialogue file ...
[override/dw#ajant.d] LEXER ERROR at line 76 column 1-4
Near Text: !
invalid character [!]
[override/dw#ajant.d] ERROR at line 76 column 1-4
Near Text: !
Parsing.Parse_error
ERROR: parsing [override/dw#ajant.d]: Parsing.Parse_error
ERROR: compiling [override/dw#ajant.d]!
Stopping installation because of error.
I'll try creating the globals without the Z! in the code just to be sure. If it works, I will be certain to give proper attribution within and follow up on this post.
And all the time, such is the tragi-comedy of our situation, we continue to clamour for those very qualities we are rendering impossible. . . . In a sort of ghastly simplicity we remove the organ and demand the function. We make men without chests and expect of them virtue and enterprise. We laugh at honour and are shocked to find traitors in our midst. We castrate and bid the geldings be fruitful.
C.S. Lewis, The Abolition of Man
#28
Posted 23 December 2008 - 11:42 PM
#29
Posted 24 December 2008 - 06:57 PM
Thanks for your patience and help.
And all the time, such is the tragi-comedy of our situation, we continue to clamour for those very qualities we are rendering impossible. . . . In a sort of ghastly simplicity we remove the organ and demand the function. We make men without chests and expect of them virtue and enterprise. We laugh at honour and are shocked to find traitors in our midst. We castrate and bid the geldings be fruitful.
C.S. Lewis, The Abolition of Man
#30
Posted 05 December 2010 - 05:56 PM
jastey, on Mar 30 2008, 03:47 AM, said:
CreateCreature() For BG1:TotSC, the syntax for CrateCreature() is the same as in BGII: "CreateCreature("name",[x.y],0)", with "0" being the face orientation of the creature.
For BG1 without TotSC, there is no face orientation: "CreateCreature("name",[x.y])" is the correct syntax here.
To code for both in one file, the method described by cmorgan's "Crossing the Great Divide" tutorial using OUTER_SPRINT has to be used (see here for more details: crossing the great divide: Coding for BG1, Tutu and BGT).
From the tp2:
/* Area Scripts for spawning */ COPY_EXISTING ~ar2301.bcs~ ~override~ ~ar4809.bcs~ ~override~ ~ar0705.bcs~ ~override~ EXTEND_BOTTOM ~ar2301.bcs~ ~Bardic/baf/X#LP1REPAS.BAF~ //The Friendly Arm Inn EXTEND_BOTTOM ~ar4809.bcs~ ~Bardic/baf/X#LP2REPAS.BAF~ //The Belching Dragon EXTEND_BOTTOM ~ar0705.bcs~ ~Bardic/baf/X#LP3REPAS.BAF~ //The ElfsongFrom the creature's baf file:
IF
Global("X#LP1RExists","GLOBAL",0)
Global("X#LakeP1RepTalk","GLOBAL",0)
THEN
RESPONSE #100
CreateCreature("X#LP1REP",[542.592],0) // Lake Poet Sam Friendly Arm Inn
SetGlobal("X#LP1RExists","GLOBAL",1)
END
IF
Global("X#TT1Deactivate","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("X#TT1Deactivate","GLOBAL",2)
SetGlobalTimer("X#TroubadorTimer1","GLOBAL",THREE_DAYS)
Wait(4)
Deactivate("X#LP1REP")
END
IF
Global("X#TT1Deactivate","GLOBAL",2)
GlobalTimerExpired("X#TroubadorTimer1","GLOBAL")
THEN
RESPONSE #100
SetGlobal("X#TT1Deactivate","GLOBAL",0)
Wait(4)
Activate("X#LP1REP")
END
I'm focusing on this code since the creature, script and dialog all seem to install with no problem. I CreateCreature and everything works fine, it just does not spawn. The spawn code looks right to me...Edit: I notice there are two GLOBALs called before the CreateCreature command. I don't find them created or set anywhere. Are they created when called, or do I need to create the GLOBALs somewhere?
Edited by grogerson, 06 December 2010 - 06:06 PM.
And all the time, such is the tragi-comedy of our situation, we continue to clamour for those very qualities we are rendering impossible. . . . In a sort of ghastly simplicity we remove the organ and demand the function. We make men without chests and expect of them virtue and enterprise. We laugh at honour and are shocked to find traitors in our midst. We castrate and bid the geldings be fruitful.
C.S. Lewis, The Abolition of Man
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











