Haplo Posted November 18, 2013 Author Share Posted November 18, 2013 Hey guys, I know you all busy making changes to your mods to make them compatible with BG2:EE, but I've got a couple of questions if you don't mind... Q: If you have to pay someone in the game and you don't have enough gold, how can I prevent this from happening? "if you click the pay option and you don't have enough the game will take what you have anyway and things will get on regardless." Looking around the IESDP, I saw a True statement, something like: IF True() THEN RESPONSE #100 Bla bla bla Is that what I need or there is a completly different way to do it? Oh... and another thing, I know there is a tutorial on how to convert your mod to BG2:EE, but my question is, Is it fairly easy or rather complicated to do it? Thanks Link to comment
Wisp Posted November 18, 2013 Share Posted November 18, 2013 Q: If you have to pay someone in the game and you don't have enough gold, how can I prevent this from happening? "if you click the pay option and you don't have enough the game will take what you have anyway and things will get on regardless." You can use the PartyGoldGT() trigger to block the payment option if the party does not posses enough gold. Oh... and another thing, I know there is a tutorial on how to convert your mod to BG2:EE, but my question is, Is it fairly easy or rather complicated to do it? It depends entirely on the mod. It's probably scales mostly with how much text the mod introduces and the number of translations (with none being easiest and the difficulty going up from there). There are some notable graphical hitches too (e.g., description BAMs no longer function). Link to comment
Haplo Posted November 18, 2013 Author Share Posted November 18, 2013 Thanks mate, that PartyGoldGT() looks very useful, I'll try and figure out how to fit it in and thanks too for clarify the BG2:EE question for me Link to comment
Haplo Posted November 18, 2013 Author Share Posted November 18, 2013 For a while I've been having this question on my mind..... is it possible to add to the IF statement ELSE?? as in... IF Global("blabla") THEN RESPONSE #100 SetGlobal("blabla") ELSE Destroyself() Say yes..... please!!!!!!!!!!!! Link to comment
Mike1072 Posted November 18, 2013 Share Posted November 18, 2013 No, but you could negate the conditions in a separate block to achieve the same thing: IF Global("blabla", "GLOBAL", 0) THEN RESPONSE #100 // do something END IF !Global("blabla", "GLOBAL", 0) THEN RESPONSE #100 // do something else END Link to comment
Haplo Posted November 19, 2013 Author Share Posted November 19, 2013 Cool!! I'll try it that way, thanks By the way, I kinda forgot how to post code in a nice way.... if someone could remind me how... Link to comment
Jarno Mikkola Posted November 19, 2013 Share Posted November 19, 2013 . if someone could remind me how... You might want to quote the above to see how it's done if you can't get it from this explanations.... [ CODE ] the actual code [ /CODE ] -just remove the spaces. Link to comment
Haplo Posted November 19, 2013 Author Share Posted November 19, 2013 Yep, got it just fine, Thanks Link to comment
Haplo Posted November 25, 2013 Author Share Posted November 25, 2013 Say, If I got this right... is it possible to negate any trigger or variable in the IE? example: !HasItem !PartyGoldGT() and so on.... or are there some exceptions? Link to comment
Mike1072 Posted November 25, 2013 Share Posted November 25, 2013 Check out the info on this page and also the scripting guide. Link to comment
Haplo Posted November 25, 2013 Author Share Posted November 25, 2013 Extremely useful, thanks Mike Link to comment
Haplo Posted November 25, 2013 Author Share Posted November 25, 2013 Mike I address this to you since you were the one that point that out for me, but anyone is more than welcome to answer Negate a variable: When I was ready to use that piece of info something came to my mind. If a negate a variable in a block such us: IF !Global("blabla","GLOBAL",2) THEN RESPONSE #100 Destroyself() END and Global("blabla") is 1 (it would be set to 2 if something entirely different happened), then... that means that Global("blabla",2) is set to false isn't? and Global("blabla",2) will always be false until it gets set to 2 right? therefore.... the condition you set in that block will always happen unless the block that sets that variable to 2 occurs... and then I asked myself, if this is true, why would I ever use something that is there anyway? I mean if my condition for something to happen is that that something is false, which is always unless a specific event occurs, then it would be false since the beggining of the game and then nothing I script would matter since the variable is always false and would trigger that response as soon as I meet however has it. amm... I have no idea if I'm making any sense at all, but I just can't get around that fact..... or maybe I'm just mixing things up.... Link to comment
Mike1072 Posted November 26, 2013 Share Posted November 26, 2013 I didn't quite follow that, but maybe this explanation will help. You generally use variables to keep track of different states. All variables start with a value of 0. If you want a set of actions to trigger when a variable is set to a specific value, that script block should change the value of the variable to prevent the block from re-triggering indefinitely. For example, IF Global("MI#SayHi","GLOBAL",0) InParty("Keldorn") See("Keldorn") THEN RESPONSE #100 DisplayString(Myself,"Doth my eyes deceive me? Keldorn?") SetGlobal("MI#SayHi","GLOBAL",1) END The variable MI#SayHi will start with the value 0, so the block will trigger the first time it is run if the other conditions are met. After executing, the variable will be set to the value 1. Any subsequent times the script is run, the trigger will be false and the actions will be skipped. If the block did not change the value of MI#SayHi, the trigger would remain true and the character would spam that text forever. At this point, you have a variable that keeps track of two states: the state before and the state after the character has said hello to Keldorn. You could reference the value of this variable in other states to create blocks that trigger only before or only after this event. Of course, if Keldorn were not in the party, the block would never trigger. So you might want to add another block (lower in the script) that would trigger if the character saw a different party member. IF Global("MI#SayHi","GLOBAL",0) See([PC]) THEN RESPONSE #100 DisplayString(Myself,"Greetings, adventurer.") SetGlobal("MI#SayHi","GLOBAL",2) END Now the variable can be in 3 different states: before saying anything, after saying hello to Keldorn, or after saying hello to someone else. You could then use a block like this. IF !Global("MI#SayHi","GLOBAL",0) Global("MI#GiveMoney","GLOBAL",0) See([PC]) THEN RESPONSE #100 Wait(3) DisplayString(Myself,"Have some money!") GivePartyGold(1000) SetGlobal("MI#GiveMoney","GLOBAL",1) END It would trigger so long as the character had said either greeting. For the same effect, you could replace the trigger !Global("MI#SayHi","GLOBAL",0) with GlobalGT("MI#SayHi","GLOBAL",0) in this particular scenario. I hope this helps to answer your question. Link to comment
Haplo Posted November 26, 2013 Author Share Posted November 26, 2013 Thanks for the reply Mike I guessed as much about how to use a negated variable, but unfortunetly my doubt still remains, let me try and rephrase it. If I use a negated variable as the ONLY condition for something to happen, then, wouldn't that something happen anyway, anywhere? As I understood it, "negate" is something like... if Global "blabla" is not set to 2 then this will happen, but the thing is, Global "blabla" is not set to 2 UNLESS it is set to 2, or in other words, Global "blabla'' 2 is true only and only if it is set to 2, otherwise is false always and therefore is in its "negated" form (if Global "blabla" is not set to 2 then this will happen). Because I understand it that way, I can get my head around the fact of why bother in negating a variable at all, if a variable is only true when is set to be (let's say you want it to be true at the value of 2), then it will always be false otherwise, so why use it in its negated form? This should mean the same, shouldn't it? IF !Global("blabla","GLOBAL",2) Globa("yeah","GLOBAL",5) THEN RESPONSE #100 Destroyself() END IF Global("yeah","GLOBAL",5) THEN RESPONSE #100 Destroyself() END Link to comment
Thimblerig Posted November 26, 2013 Share Posted November 26, 2013 why bother in negating a variable at all, if a variable is only true when is set to be (let's say you want it to be true at the value of 2), then it will always be false otherwise, so why use it in its negated form? Well, sometimes we're interested in a variable being one specific value, and sometimes we want it to not be one specific value. One pretty common use is in the NumTimesTalkedTo Local that all the creatures automatically get. You might get a dialogue block that looks like: // Flying Spaghetti Monster IF ~Global("NumTimesTalkedTo","LOCALS",0)~ fsm.hello // We've never talked to this guy, so NumTime.etc. is 0 SAY ~Howdy. I'm a flying spaghetti monster.~ EXIT IF ~!Global("NumTimesTalkedTo","LOCALS",0)~ fsm.we.meet.again // GlobalGT also works here SAY ~Hello again. Do you like noodles?~ EXIT Or maybe we want to get fancy when tracking a quest - assume we have one Global that has a different integer depending on how far along we've gotten ("T1SpaghettiQuest"). - 0 means we haven't been given it - 1 means we've agreed to the quest but haven't done anything about it - 2 means we've gotten to a part of the quest where Flying Spaghetti Monster is very angry with us - 3 and upwards various kinds of quest resolutions. Perhaps we ate the spaghetti, maybe we gave it away, maybe we brought it back with meatballs - I don't know, it's all a grand tapestry. we might see blocks like: // never met, no quest. IF ~Global("T1SpaghettiQuest","GLOBAL",0)~ fsm.hello SAY ~Hello, stranger. Could you bring me some spaghetti?~ // more stuff END // have met, so not zero; haven't annoyed the monster, so not 2 IF ~!Global("T1SpaghettiQuest","GLOBAL",0) !Global("T1SpaghettiQuest","GLOBAL",2) ~ fsm.friendly SAY ~Hello, my friend! Where's my spaghetti?~ // more stuff END IF ~Global("T1SpaghettiQuest","GLOBAL",2)~ fsm.hostile SAY ~I'm not talking to you!~ EXIT If a Global hasn't been formally set, it will return 0 when the game looks for it. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.