Twani Posted February 12, 2014 Author Share Posted February 12, 2014 I made a cutscene! Finally! Yay! Back to this project after two weeks engrossed in Star Wars. I have a Dorn and Rasaad banter that I need to trigger through script rather then through random banter, as it has conditions and all that and I understand those are better done by script then just bantering them and hoping for the best (anyway, I need to learn how to trigger banters by script so I can do it for the eventual love confrontations that I will hopefully one day get permission to do). The question: because it's Dorn and Rasaad and their quest globals, can I do it in my main script file that has all other scripts? Or will that crash BGT/BGTutu and instead I have to do it in a separate BGEE script file? Link to comment
Mike1072 Posted February 12, 2014 Share Posted February 12, 2014 If you check a variable that hasn't been set, the game will report its value as 0. There won't be an error. The same goes for checking if a nonexistent creature is in the party: they're not. So, in your scripts, you should be able to reasonably safeguard your actions. However, you might eventually want to reference files that only exist in BGEE games. Separating all the BGEE stuff and installing it only on BGEE installations is safest and makes the most sense from an organizational perspective. Link to comment
jastey Posted February 12, 2014 Share Posted February 12, 2014 What Mike1072 said last: You'll thank yourself one day if you separate content that will only be installed separately, i.e. the EE contents as well as ToB content, for example. But you don't have to do it, as long as you are only checking, you can use any GLOBAL variable name or creature script name you want. If it comes to adding to a skript or dialogue file, though, then those have to be present or the installation fails. If you start scripting triggered dialogues, have a look at Kulyok's How to ensure your banters always run when you want them to , as it is THE way to script dialogues so they do not stutter, ever. And remember: Put all the trigger conditions into the script block, and only use the one trigger variable for this dialogue in the dialogue block, again prevents stuttering (and always check for the trigger variable in the script block first and close it in the dialogue, while I am at it!) Link to comment
Twani Posted February 12, 2014 Author Share Posted February 12, 2014 Gah, and of course poor PPG is down just when I needed it. Thanks, both of you. I'll put my BGEE stuff in a different script file for just in case reasons in the future, and I'll check out that link when PPG comes back up. Link to comment
Kulyok Posted February 13, 2014 Share Posted February 13, 2014 No problem whatsoever, I mirror all my tutorials on G3. Here you go: http://forums.gibberlings3.net/index.php?showtopic=9760 And take a look at G3 tutorial index, maybe you'll find something else interesting: http://forums.gibberlings3.net/index.php?showtopic=652 Congrats on making a cutscene, by the way! I know they're a huge pain, especially at first(I keep reloading and reinstalling mine six or seven times until they work the way I want them). Link to comment
Twani Posted February 13, 2014 Author Share Posted February 13, 2014 Aha, thank you! I was already, um, sort of stealing scripts from Branwen, so I sort of had that already going, but I'm glad to have read it again because that explains everything. So, just to make sure on this... I have two banter files, the regular M3BAlt and then I think it's M3AltEE for the EE weirdos. Banters in them will run normally whenever the engine does a quip and goes 'Hey, banter time!'- I don't need to specifically code most banters. However, the Banters I do code (specifically, I'm thinking, the Dorn and Rasaad quest ones, two Monty ones on rest, and a Garrick one in a tavern) should be coded by script. After being coded by script, they will not run when the banter engine goes 'blip', but will only run when my coded conditions come to play. Am I right with this? I think I am, but I just want to make sure. Link to comment
Kulyok Posted February 14, 2014 Share Posted February 14, 2014 You're right, absolutely. The difference is this: when you code "normal" banters, you set a condition: ABCBanterVariable=0, and then you set it to 1 after the banter. So the banter engine "sees" this banter(variable=0). But when you code "scripted" banters, you usually set a condition ABCBanterVariable=1(and you set it to 2 after the banter), so the banter engine does not see this banter(the variable is set to 1 via your script, and the script triggers the banter). Link to comment
jastey Posted February 14, 2014 Share Posted February 14, 2014 Also, you trigger the banters from the Bxxx.dlg via "Interact()" (if you would trigger them, that is), and the scripted dialogues go into the xxxJ.dlg, and they are initiated by "StartDialogNoSet()". Link to comment
Kulyok Posted February 14, 2014 Share Posted February 14, 2014 I use B files and Interact for NPC-NPC banters anyway, because I often make scripted banters unscripted and vice versa. Link to comment
Twani Posted February 25, 2014 Author Share Posted February 25, 2014 Thanks, guys. I think I get it. Coding is actually going pretty well, now- it's the dialog that's being hard. However, I'm trying to now code two banters and a lovetalk that trigger at rest. I'm a bit confused on how to do this, though. It seems for most mods, dialog that triggers at rest is put in the D/dream script file... is that correct? I'm not going to ask you guys to provide me with an example written out, but does anyone know of a mod offhand that makes use of at rest dialogs that's scripts are relatively sensibly scripted? And even more bemusing to me, how to do you make a dialog trigger after rest, for like, the standard morning after talk? Link to comment
Rhaella Posted February 25, 2014 Share Posted February 25, 2014 I use both quite a bit, so let's see. Simplifying my scripting to the basics since I do strange things with extra variables sometimes. At rest in D script: IF InParty(Myself) !StateCheck(Myself,CD_STATE_NOTVALID) !StateCheck(Player1,CD_STATE_NOTVALID) Global("rh#IsraTalksBG1","GLOBAL",15) RealGlobalTimerExpired("rh#IsraTalksBG1Timer","GLOBAL") OR(21) // leaving the list here in case you need it AreaCheck("%Beregost_FeldepostsInn_L1%") AreaCheck("%Beregost_JovialJuggler_L1%") AreaCheck("%Beregost_RedSheaf_L1%") AreaCheck("%Beregost_BurningWizard_L1%") AreaCheck("%Nashkel_Inn%") AreaCheck("%EBaldursGate_KeexieTavern_L1%") AreaCheck("%EBaldursGate_ElfsongTavern_L1%") AreaCheck("%EBaldursGate_Inn_L1%") AreaCheck("%SEBaldursGate_Inn_L1%") AreaCheck("%SEBaldursGate_Blade&Stars_L1%") AreaCheck("%BaldursGateDocks_JopalinsTavern%") AreaCheck("%SWBaldursGate_Tavern_L1%") AreaCheck("%SWBaldursGate_YeOldeInn_L1%") AreaCheck("%NWBaldursGate_Helm&Cloak_L1%") AreaCheck("%NWBaldursGate_Tavern_L1%") AreaCheck("%NBaldursGate_ThreeOldKegs_L1%") AreaCheck("%NEBaldursGate_BlushingMermaid_L1%") AreaCheck("%NEBaldursGate_SplurgingSturgeon_L2%") AreaCheck("%FriendlyArmInn_L1%") AreaCheck("%NEBaldursGate_SplurgingSturgeon_L1%") AreaCheck("%UlgothsBeard_Inn%") THEN RESPONSE #100 SetGlobal("rh#IsraTalksBG1","GLOBAL",16) Dialogue(Player1) END You only want one block of scripting in the D file, not the two that you normally have. The engine will only pick up one at a time upon rest. Morning talk would go in the regular script: IF InParty(Myself) See(Player1) !StateCheck(Myself,CD_STATE_NOTVALID) !StateCheck(Player1,CD_STATE_NOTVALID) RealGlobalTimerExpired("rh#IsraTalksBG1Timer","GLOBAL") CombatCounter(0) !See([ENEMY]) ReputationGT(Player1,9) PartyRested() // <-- this is the only thing that's different. Global("rh#IsraTalksBG1","GLOBAL",9) THEN RESPONSE #100 IncrementGlobal("rh#IsraTalksBG1","GLOBAL",1) END IF InParty(Myself) See(Player1) !StateCheck(Myself,CD_STATE_NOTVALID) !StateCheck(Player1,CD_STATE_NOTVALID) RealGlobalTimerExpired("rh#IsraTalksBG1Timer","GLOBAL") CombatCounter(0) !See([ENEMY]) ReputationGT(Player1,9) Global("rh#IsraTalksBG1","GLOBAL",10) THEN RESPONSE #100 Dialogue(Player1) END You don't strictly need to put PartyRested() in if you're continuing from a talk that took place upon rest, since you can instead trigger a new dialogue immediately after the previous one. It should then trigger right after you wake up. Link to comment
Kulyok Posted February 25, 2014 Share Posted February 25, 2014 Rhaella provided great code already(and two blocks for the regular talk is just what the doctor ordered). During testing Xan, though, I did get two dialogues at rest(i.e. on a fast computer, you'll get a waking-up dialogue before you actually rest), so I would still recommend using PartyRested() condition in your morning talk(use PartyRested() in the first block only, not the second). Link to comment
Twani Posted February 25, 2014 Author Share Posted February 25, 2014 Alright! Seems simple enough. I'll see if I can get it to work tomorrow; thank you both! Link to comment
Ardanis Posted February 26, 2014 Share Posted February 26, 2014 OR(21) // leaving the list here in case you need it... Note that you can also assign areas an inn/tavern flag, and use a simple area type check instead of a lengthy list. aTweaks has the necessary code, I think. Link to comment
Wisp Posted March 1, 2014 Share Posted March 1, 2014 aTweaks has the necessary code, I think. It's even modular and kind of documented. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.