Xeniorn Posted March 16, 2004 Share Posted March 16, 2004 I need some help with my script. It is supposed to turn the player to a vampire, or cure his vampirism. But whenever I equip the scripted amulet, and click on any button, it does nothing. Here is my script: BEGIN ZZ_VAMPIREMAKER_SCRIPT short OnPCEquipshort vampire if (OnPCEquip == 1)if (vampire == 1) messagebox, "Do you wish to be cured?""Yes""No" if (Getbuttonpressed == 0) Player->RemoveSpell, "Vampire Attributes" Player->RemoveSpell, "Vampire Skills" Player->RemoveSpell, "Vampire Immunities" Player->RemoveSpell, "Vampire Sun Damage" Player->RemoveSpell, "Vampire Touch" Player->RemoveSpell, "Vampire Aundae Specials" Player->RemoveSpell, "Vampire Berne Specials" Player->RemoveSpell, "Vampire Quarra Specials" StopScript vampdreamScript set vampire to 0 endif if (Getbuttonpressed == 1) return endifendif if (vampire == 0) messagebox, "You feel dark power running through your veins. Which blood would you like to have?""Aundae""Berne""Quarra""Nevermind"endif if (GetButtonPressed == 0) messagebox, "The blood of Aundae now runs through your veins." Player->AddSpell, "Vampire Attributes" Player->AddSpell, "Vampire Skills" Player->AddSpell, "Vampire Immunities" Player->AddSpell, "Vampire Sun Damage" Player->AddSpell, "Vampire Touch" Player->AddSpell, "Vampire Aundae Specials" set vampire to 1endif if (GetButtonPressed == 1) messagebox, "The blood of Berne now runs through your veins." Player->RemoveSpell, "Vampire Attributes" Player->RemoveSpell, "Vampire Skills" Player->RemoveSpell, "Vampire Immunities" Player->RemoveSpell, "Vampire Sun Damage" Player->RemoveSpell, "Vampire Touch" Player->RemoveSpell, "Vampire Berne Specials" set vampire to 1endif if (GetButtonPressed == 2) messagebox, "The blood of Quarra now runs through your veins." Player->RemoveSpell, "Vampire Attributes" Player->RemoveSpell, "Vampire Skills" Player->RemoveSpell, "Vampire Immunities" Player->RemoveSpell, "Vampire Sun Damage" Player->RemoveSpell, "Vampire Touch" Player->RemoveSpell, "Vampire Quarra Specials" set vampire to 1 endif if (GetButtonPressed == 3)returnendifSet OnPCEquip to 0endif end ZZ_VAMPIREMAKER_SCRIPT So, could anyone tell me why it doesn't work? Link to comment Share on other sites More sharing options...
Lord Of The Cheese Posted March 16, 2004 Share Posted March 16, 2004 you had a mistake in the if (vampire == 0 ), it got but the button message, then ended, so it wouldnt check which button you pressed so i would move it down to the bottom, also near the end, the when it checks for berne and Quarra button pressed, you have remove spell, which i believe u wanted addspell instead, so i wuold do something like this BEGIN ZZ_VAMPIREMAKER_SCRIPT short OnPCEquip short vampire if (OnPCEquip == 1) if (vampire == 1) messagebox, "Do you wish to be cured?""Yes""No" if (Getbuttonpressed == 0) Player->RemoveSpell, "Vampire Attributes" Player->RemoveSpell, "Vampire Skills" Player->RemoveSpell, "Vampire Immunities" Player->RemoveSpell, "Vampire Sun Damage" Player->RemoveSpell, "Vampire Touch" Player->RemoveSpell, "Vampire Aundae Specials" Player->RemoveSpell, "Vampire Berne Specials" Player->RemoveSpell, "Vampire Quarra Specials" StopScript vampdreamScript set vampire to 0 endif if (Getbuttonpressed == 1) return endif endif if (vampire == 0) messagebox, "You feel dark power running through your veins. Which blood would you like to have?""Aundae""Berne""Quarra""Nevermind" if (GetButtonPressed == 0) messagebox, "The blood of Aundae now runs through your veins." Player->AddSpell, "Vampire Attributes" Player->AddSpell, "Vampire Skills" Player->AddSpell, "Vampire Immunities" Player->AddSpell, "Vampire Sun Damage" Player->AddSpell, "Vampire Touch" Player->AddSpell, "Vampire Aundae Specials" set vampire to 1 endif if (GetButtonPressed == 1) messagebox, "The blood of Berne now runs through your veins." Player->AddSpell, "Vampire Attributes" Player->AddSpell, "Vampire Skills" Player->AddSpell, "Vampire Immunities" Player->AddSpell, "Vampire Sun Damage" Player->AddSpell, "Vampire Touch" Player->AddSpell, "Vampire Berne Specials" set vampire to 1 endif if (GetButtonPressed == 2) messagebox, "The blood of Quarra now runs through your veins." Player->AddSpell, "Vampire Attributes" Player->AddSpell, "Vampire Skills" Player->AddSpell, "Vampire Immunities" Player->AddSpell, "Vampire Sun Damage" Player->AddSpell, "Vampire Touch" Player->AddSpell, "Vampire Quarra Specials" set vampire to 1 endif if (GetButtonPressed == 3) return endif Set OnPCEquip to 0 endif endif end ZZ_VAMPIREMAKER_SCRIPT Link to comment Share on other sites More sharing options...
Xeniorn Posted March 19, 2004 Author Share Posted March 19, 2004 I tried your script, it didn't work. I also tried this one: BEGIN ZZ_VAMPIREMAKER_SCRIPT short OnPCEquipshort vampire if ( Player->GetSpell "werewolf blood" == 1 )returnendif if ( PCWereWolf == 1 ) returnendif if ( PCVampire != 0 )returnendif if (OnPCEquip == 1)if (vampire == 1) messagebox, "Do you wish to be cured?""Yes""No"if (Getbuttonpressed == 0)Player->RemoveSpell, "Vampire Attributes"Player->RemoveSpell, "Vampire Skills"Player->RemoveSpell, "Vampire Immunities"Player->RemoveSpell, "Vampire Sun Damage"Player->RemoveSpell, "Vampire Touch"Player->RemoveSpell, "Vampire Aundae Specials"Player->RemoveSpell, "Vampire Berne Specials"Player->RemoveSpell, "Vampire Quarra Specials"Player->RemoveSpell, "Vampire Blood Aundae"Player->RemoveSpell, "Vampire Blood Berne"Player->RemoveSpell, "Vampire Blood Quarra" StopScript vampdreamScriptset vampire to 0endifif (Getbuttonpressed == 1)returnendifelsemessagebox, "You feel dark power running through your veins. Which blood would you like to have?""Aundae""Berne""Quarra""Nevermind"endifif (GetButtonPressed == 0)messagebox, "The blood of Aundae now runs through your veins."Player->RemoveSpell, "Vampire Blood Aundae"Player->RemoveSpell, "Vampire Blood Berne"Player->RemoveSpell, "Vampire Blood Quarra"StartScript vampire_aundae_PCset vampire to 1endif if (GetButtonPressed == 1)messagebox, "The blood of Berne now runs through your veins."Player->RemoveSpell, "Vampire Blood Aundae"Player->RemoveSpell, "Vampire Blood Berne"Player->RemoveSpell, "Vampire Blood Quarra"StartScript vampire_berne_PCset vampire to 1endif if (GetButtonPressed == 2)messagebox, "The blood of Quarra now runs through your veins."Player->RemoveSpell, "Vampire Blood Aundae"Player->RemoveSpell, "Vampire Blood Berne"Player->RemoveSpell, "Vampire Blood Quarra"StartScript vampire_quarra_PCset vampire to 1 endif if (GetButtonPressed == 3)returnendifSet OnPCEquip to 0endifendif end ZZ_VAMPIREMAKER_SCRIPT But it still doesn't work. The messagebox poppes up, but it does nothing. Plz help. Link to comment Share on other sites More sharing options...
Wookiee Posted March 21, 2004 Share Posted March 21, 2004 try closing your if loops a lil earlyer (i know it shouldent make much of a difrence but morrowind scripting sometimes isent logical) Link to comment Share on other sites More sharing options...
ThetaOrionis01 Posted March 21, 2004 Share Posted March 21, 2004 Argh...stupid forum seems to have eaten my reply... <_< Check Scripting for Dummies - it has a lot of information on message boxes and choices. Try these two things in particular: - declare a new short variable 'button', set button to GetButtonPressed and use the button variable instead of the GetButtonPressed function to check the player's choice - introduce a control variable to check that the messagebox has been displayed. Declare a short control variable, introduce a new if/endif condition so the messagebox command is only valid when the variable has a certain value, then immediately after the messagebox command set the variable to a different value - eg: If ( variable == 0 ) If ( whatever other conditions apply are met) Messagebox 'whatever', 'yes', 'no', 'etc' Set variable to 1 endifendif Then use variable == 1 as a new condition when checking for the player's choices. If ( variable == 1) Set button to GetButtonPressed If ( button == whatever ) etc Scripting for Dummies has some sample scripts for messagebox choices - refer to those for more information. I found the teleport ring sample script very useful.... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.