Jump to content

Script Help


Xeniorn

Recommended Posts

Posted

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 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"

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 1

endif

 

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 1

endif

 

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)

return

endif

Set OnPCEquip to 0

endif

 

end ZZ_VAMPIREMAKER_SCRIPT

 

So, could anyone tell me why it doesn't work?

Posted

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

Posted

I tried your script, it didn't work. I also tried this one:

BEGIN ZZ_VAMPIREMAKER_SCRIPT

 

short OnPCEquip

short vampire

 

if ( Player->GetSpell "werewolf blood" == 1 )

return

endif

 

if ( PCWereWolf == 1 ) 

return

endif

 

if ( PCVampire != 0 )

return

endif

 

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 vampdreamScript

set vampire to 0

endif

if (Getbuttonpressed == 1)

return

endif

else

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->RemoveSpell, "Vampire Blood Aundae"

Player->RemoveSpell, "Vampire Blood Berne"

Player->RemoveSpell, "Vampire Blood Quarra"

StartScript vampire_aundae_PC

set vampire to 1

endif

 

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_PC

set vampire to 1

endif

 

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_PC

set vampire to 1

endif

 

if (GetButtonPressed == 3)

return

endif

Set OnPCEquip to 0

endif

endif

 

end ZZ_VAMPIREMAKER_SCRIPT

 

But it still doesn't work. The messagebox poppes up, but it does nothing. Plz help.

Posted
try closing your if loops a lil earlyer (i know it shouldent make much of a difrence but morrowind scripting sometimes isent logical)
Posted

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

endif

endif

 

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....

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...