Echon Posted April 2, 2005 Share Posted April 2, 2005 The game crashes when I try to use this action. I would like somebody to confirm that it does not work. The script I used it in is as follows: IF See(Player1) GlobalGT("Spell","LOCALS",4) THEN RESPONSE #100 ForceSpell(Player1,WIZARD_MAGIC_MISSILE) END IF See(Player1) GlobalLT("Spell","LOCALS",5) THEN RESPONSE #100 IncrementGlobal("Spell","LOCALS",1) END -Echon Link to comment
Roana Posted April 2, 2005 Share Posted April 2, 2005 The game crashes when I try to use this action. I would like somebody to confirm that it does not work. The script I used it in is as follows: IF See(Player1) GlobalGT("Spell","LOCALS",4) THEN RESPONSE #100 ForceSpell(Player1,WIZARD_MAGIC_MISSILE) END IF See(Player1) GlobalLT("Spell","LOCALS",5) THEN RESPONSE #100 IncrementGlobal("Spell","LOCALS",1) END -Echon <{POST_SNAPBACK}> You have made a little fault in this script, that I usually like to do too Your Char is hanging in a loop, because he will try tot spell the given spell over and over. Try to change it like this: IF See(Player1) GlobalGT("Spell","LOCALS",4) GlobalLT("Spell","LOCALS",6) THEN RESPONSE #100 ForceSpell(Player1,WIZARD_MAGIC_MISSILE) IncrementGlobal("Spell","LOCALS",1) END IF See(Player1) GlobalLT("Spell","LOCALS",5) THEN RESPONSE #100 IncrementGlobal("Spell","LOCALS",1) END I guess, then the game will like you more. Because of the lack of many usefull trigger in BG1 that are possible in BG2, scripting in BG1 is almost ever to got long ways to your goal. In the example above the Trigger *HaveSpell...* would be very usefull - but - it is not existent in BG1 - sadly. Roana Link to comment
Avenger Posted April 3, 2005 Share Posted April 3, 2005 Even that wouldn't save his butt as nothing would move the variable away from 5. Before casting the spell, reset the variable. Link to comment
Echon Posted April 4, 2005 Author Share Posted April 4, 2005 You have made a little fault in this script, that I usually like to do too Your Char is hanging in a loop, because he will try tot spell the given spell over and over. That is not an error but a feature. I often have the test creature cast the same spell over and over and it does not make the game crash. Because of the lack of many usefull trigger in BG1 that are possible in BG2, scripting in BG1 is almost ever to got long ways to your goal. In the example above the Trigger *HaveSpell...* would be very usefull - but - it is not existent in BG1 - sadly. http://iesdp.gibberlings3.net/scripting/bg1triggers.htm ->0x4031 Without HaveSpell(), scripting spellcasters would be impossible. -Echon Link to comment
Yovaneth Posted April 4, 2005 Share Posted April 4, 2005 Even that wouldn't save his butt as nothing would move the variable away from 5.Before casting the spell, reset the variable. <{POST_SNAPBACK}> Yup. This *might* do it: IF See(Player1) GlobalGT("Spell","LOCALS",4) GlobalLT("Spell","LOCALS",6) THEN RESPONSE #100 ForceSpell(Player1,WIZARD_MAGIC_MISSILE) IncrementGlobal("Spell","LOCALS",1) END -Y- Link to comment
Avenger Posted April 4, 2005 Share Posted April 4, 2005 Even that wouldn't save his butt as nothing would move the variable away from 5.Before casting the spell, reset the variable. <{POST_SNAPBACK}> Yup. This *might* do it: IF See(Player1) GlobalGT("Spell","LOCALS",4) GlobalLT("Spell","LOCALS",6) THEN RESPONSE #100 ForceSpell(Player1,WIZARD_MAGIC_MISSILE) IncrementGlobal("Spell","LOCALS",1) END -Y- <{POST_SNAPBACK}> IF See(Player1) Global("Spell","LOCALS",5) THEN Seems easier. Link to comment
Yovaneth Posted April 4, 2005 Share Posted April 4, 2005 IF See(Player1) Global("Spell","LOCALS",5) THEN Seems easier. <{POST_SNAPBACK}> Not arguing with that! I just assumed that Echon needed to increment the variable around a test. -Y- Link to comment
Echon Posted April 5, 2005 Author Share Posted April 5, 2005 I tried your suggestions but the game still crashes. It does not even give me an AssertionFailed error. -Echon Link to comment
Yovaneth Posted April 5, 2005 Share Posted April 5, 2005 I tried your suggestions but the game still crashes. It does not even give me an AssertionFailed error. <{POST_SNAPBACK}> Mmmm. Okay, using my code suggestion, try using a hotkey trigger and a line-by-line reintroduction until it crashes e.g. //Try 1 IF HotKey(T) // See(Player1) // GlobalGT("Spell","LOCALS",4) // GlobalLT("Spell","LOCALS",6) THEN RESPONSE #100 ForceSpell(Player1,WIZARD_MAGIC_MISSILE) // IncrementGlobal("Spell","LOCALS",1) END //Try 2 IF HotKey(T) See(Player1) // GlobalGT("Spell","LOCALS",4) // GlobalLT("Spell","LOCALS",6) THEN RESPONSE #100 ForceSpell(Player1,WIZARD_MAGIC_MISSILE) // IncrementGlobal("Spell","LOCALS",1) END //Try 3 IF HotKey(T) See(Player1) // GlobalGT("Spell","LOCALS",4) // GlobalLT("Spell","LOCALS",6) THEN RESPONSE #100 ForceSpell(Player1,WIZARD_MAGIC_MISSILE) IncrementGlobal("Spell","LOCALS",1) END //etc Sooner or later you'll identify the crash line, at which point I'm quite willing to try and reproduce the fault. The idea of the HotKey is simply to give you full control over when the script section fires. -Y- Link to comment
Echon Posted April 5, 2005 Author Share Posted April 5, 2005 I have identified the problem. This block crashes the game: IF True() THEN RESPONSE #100 IncrementGlobal("Test","LOCALS",1) END These two work: IF True() THEN RESPONSE #100 IncrementGlobal("Test","GLOBAL",1) END IF True() THEN RESPONSE #100 IncrementGlobal("Test","AR2600",1) END -Echon Link to comment
igi Posted April 5, 2005 Share Posted April 5, 2005 So it would seen IncrementGlobal cannot increment Local variables in BG1. Can anyone confirm it can do so in BG2? Link to comment
Yovaneth Posted April 5, 2005 Share Posted April 5, 2005 It definitely works in BG2. <{POST_SNAPBACK}> Confirmed. I've just used it as part of a randomiser in a major script. -Y- Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.