Jump to content

Photo

BG1 coding tutorial


49 replies to this topic

#46 jastey

jastey
  • Gibberlings
  • 7530 posts
  • Gender:Female

Posted 23 January 2013 - 01:53 PM

My newest experience:

CHAIN, followed by reply options, does only work properly if the last speaker (dlg) is the same as the first one. Otherwise, the reply options will show after the first line in combination with a "continue" button. If the CONTINUE is clicked on, the interjections show, but the reply options are shown in every line, too.

#47 Miloch

Miloch

    Barbarian

  • Modders
  • 4819 posts
  • Gender:Male
  • Location:At Large

Posted 27 January 2013 - 11:41 AM

I used DestroyItem() in the dplayer3.bcs and it was not processed. Everything else in that script block was (creation of a cre and journal entry). I changed the code now so a dialogue pops up (which is better for my purpose) so I would have to recode to check but I did it because the item destruction didn't work in several tries. (Item was in the inventory etc. pp)

Hmm, guess I will have to retest in BG1, but plainab did that pretty extensively for Xvart Caverns and I'm pretty sure he'd've reported it if it wasn't working. Gads know I fixed umpzehn other bugs on account of his reports.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett


#48 jastey

jastey
  • Gibberlings
  • 7530 posts
  • Gender:Female

Posted 25 August 2013 - 03:16 AM

The tutorial needs to be updated concerning variable handling / storage:

LOCALS do not get stored in the save game, i.e. will be gone upon reload.
GLOBAL are limited to 1024 for BG(TotSC) and 512 for plain BG. This leads to serious difficulties to finish a modded game. For this, the BG1 engine FIX - extending limit of maximum GLOBAL variables alters the exe to increase the amount of GLOBAL variables to 4096.

Thank you again, Zed for your work and Lava for pointing this out to me!

#49 jastey

jastey
  • Gibberlings
  • 7530 posts
  • Gender:Female

Posted 24 March 2014 - 10:40 PM

The tutorial should note that the search function in NI is limited due to many instances of faulty trigger / action syntax in BG1. Link: http://forums.gibber...ndpost&p=220632

#50 jastey

jastey
  • Gibberlings
  • 7530 posts
  • Gender:Female

Posted 18 June 2018 - 06:12 AM

More CHAIN woes in BG1: a CHAIN followed by reply options will skip all NPC interjections inbetween completely. To avoid this, the reply options have to be moved into an own dialogue state following the CHAIN. Example:

 

This:

 

CHAIN
IF ~~ THEN ~%MINSC_JOINED%~ girdleminscslumber
@144
== ~%MINSC_JOINED%~ IF ~InParty("Dynaheir") !StateCheck("Dynaheir",CD_STATE_NOTVALID)~ THEN @145
== ~%DYNAHEIR_JOINED%~ IF ~InParty("Dynaheir") !StateCheck("Dynaheir",CD_STATE_NOTVALID)~ THEN @146
== ~%ALORA_JOINED%~ IF ~InParty("Alora") !StateCheck("Alora",CD_STATE_NOTVALID)~ THEN @147
= @148
== ~%IMOEN_JOINED%~ IF ~InParty("%IMOEN_DV%") !StateCheck("%IMOEN_DV%",CD_STATE_NOTVALID)~ THEN @177
== ~%MINSC_JOINED%~ IF ~InParty("%IMOEN_DV%") !StateCheck("%IMOEN_DV%",CD_STATE_NOTVALID)~ THEN @178
== ~%MINSC_JOINED%~ IF ~~ THEN @180
END
++ @181 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
+ ~Gender(Player1,FEMALE)~ + @182 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
++ @183 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
+ ~Gender(Player1,MALE)~ + @184 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
++ @185 EXTERN ~%MINSC_JOINED%~ girdleminscslumberboo
++ @186 EXTERN ~%MINSC_JOINED%~ girdleminscslumberno

 

will play ingame as:

 

CHAIN
IF ~~ THEN ~%MINSC_JOINED%~ girdleminscslumber
@144
END
++ @181 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
+ ~Gender(Player1,FEMALE)~ + @182 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
++ @183 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
+ ~Gender(Player1,MALE)~ + @184 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
++ @185 EXTERN ~%MINSC_JOINED%~ girdleminscslumberboo
++ @186 EXTERN ~%MINSC_JOINED%~ girdleminscslumberno

 

For the NPC interjections to show, it has to be scripted the following (adding the need of anothe dialogue line):

 

CHAIN
IF ~~ THEN ~%MINSC_JOINED%~ girdleminscslumber
@144
== ~%MINSC_JOINED%~ IF ~InParty("Dynaheir") !StateCheck("Dynaheir",CD_STATE_NOTVALID)~ THEN @145
== ~%DYNAHEIR_JOINED%~ IF ~InParty("Dynaheir") !StateCheck("Dynaheir",CD_STATE_NOTVALID)~ THEN @146
== ~%ALORA_JOINED%~ IF ~InParty("Alora") !StateCheck("Alora",CD_STATE_NOTVALID)~ THEN @147
= @148
== ~%IMOEN_JOINED%~ IF ~InParty("%IMOEN_DV%") !StateCheck("%IMOEN_DV%",CD_STATE_NOTVALID)~ THEN @177
== ~%MINSC_JOINED%~ IF ~InParty("%IMOEN_DV%") !StateCheck("%IMOEN_DV%",CD_STATE_NOTVALID)~ THEN @178
== ~%MINSC_JOINED%~ IF ~~ THEN @180
END
IF ~~ THEN + interim_test

CHAIN
IF ~~ THEN ~%MINSC_JOINED%~ interim_test
@360

END
++ @181 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
+ ~Gender(Player1,FEMALE)~ + @182 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
++ @183 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
+ ~Gender(Player1,MALE)~ + @184 EXTERN ~%MINSC_JOINED%~ girdleminscslumberyes
++ @185 EXTERN ~%MINSC_JOINED%~ girdleminscslumberboo
++ @186 EXTERN ~%MINSC_JOINED%~ girdleminscslumberno
 

 





Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users