having trouble with werewolf disease script...:(

Post » Fri Jun 22, 2012 6:50 pm

i have been trying to make a mod similar to sabregirl's SG_clansofvardenfell and im having trouble getting this script to work...heres mine and then hers

begin FMS_werecheck
short currentDay
short dayCount
short hasDisease
short state
 
if ( PCVampire == 1 )
return
endif
if ( state == -1 )
return
endif
if ( state == 10 )
MessageBox "'You feel strange, Stronger, faster. . . better. You can feel the beast within you. ", "Ok"
set FMS_werewolf to 1
;check which clan they are
if ( player->GetSpell "werewolf blood Crimson" == 1 )
Set wereclan to 1
startscript FMS_werecolor
set PCwerewolf to 1
startscript werechangescript
Player->addspell FMS_crimsonwolf_h
Player->addspell FMS_wereabilities
Player->removespell "werewolf blood crimson"
set state to -1

endif
endif
if ( PCwerewolf != 0 )
stopscript FMS_werecheck ;stop this script if they become a werewolf
return
endif
 
if ( player->GetSpell "werewolf blood Crimson" == 1 )
if ( hasDisease == 0 )
set hasDisease to 1
set currentDay to Day
endif
 
else
if ( hasDisease == 1 ) ;they had it at one point, but don't anymore
set hasDisease to 0
set currentDay to 0
set dayCount to 0
endif
endif
if ( hasDisease == 1 ) ;has disease will get set back to 0 before here if they cured it
if ( currentDay != day ) ;the day has changed, so up the count
set dayCount to dayCount + 1
set currentDay to Day
endif
if ( dayCount >= 3 ) ;goes over 3 days
set state to 10

endif
endif
endif
end FMS_werecheck

and hers...

begin sg_werecheck

short currentDay
short dayCount
short hasDisease
short state
if ( PCwerewolf != 0 )
stopscript sg_werecheck ;stop this script if they become a werewolf
return
endif
if ( state == 10 )
MessageBox "'You feel strange, Stronger, faster. . . better. You can feel the beast within you. ", "Ok"
set state to -1
set sg_werewolf to 1
;check which clan they are
if ( player->GetSpell "werewolf blood red" == 1 )
Set wereclan to 1
startscript sg_werecolor
set PCwerewolf to 1
startscript werechangescript
Player->addspell sg_redwolf_h
Player->addspell sg_wolfheart
Player->removespell "werewolf blood red"

elseif ( player->GetSpell "werewolf blood black" == 1 )
Set wereclan to 2
startscript sg_werecolor
set PCwerewolf to 1
startscript werechangescript
Player->addspell sg_blackwolf_h
Player->addspell sg_wolfheart
Player->removespell "werewolf blood black"
elseif ( player->GetSpell "werewolf blood gold" == 1 )
Set wereclan to 3
startscript sg_werecolor
set PCwerewolf to 1
startscript werechangescript
Player->addspell sg_goldwolf_h
Player->addspell sg_wolfheart
Player->removespell "werewolf blood gold"
elseif ( player->GetSpell "werewolf blood arctic" == 1 )
Set wereclan to 4
startscript sg_werecolor
set PCwerewolf to 1
startscript werechangescript
Player->addspell sg_whitewolf_h
Player->addspell sg_wolfheart
Player->removespell "werewolf blood arctic"
endif

endif
 
 
if ( player->GetSpell "werewolf blood red" == 1 )
if ( hasDisease == 0 )
set hasDisease to 1
set currentDay to Day
endif
elseif ( player->GetSpell "werewolf blood black" == 1 )
if ( hasDisease == 0 )
set hasDisease to 1
set currentDay to Day
endif
elseif ( player->GetSpell "werewolf blood gold" == 1 )
if ( hasDisease == 0 )
set hasDisease to 1
set currentDay to Day
endif
elseif ( player->GetSpell "werewolf blood arctic" == 1 )
if ( hasDisease == 0 )
set hasDisease to 1
set currentDay to Day
endif
 
else
if ( hasDisease == 1 ) ;they had it at one point, but don't anymore
set hasDisease to 0
set currentDay to 0
set dayCount to 0
endif
endif
 
if ( hasDisease == 1 ) ;has disease will get set back to 0 before here if they cured it
if ( currentDay != day ) ;the day has changed, so up the count
set dayCount to dayCount + 1
set currentDay to Day
endif
if ( dayCount >= 3 ) ;goes over 3 days
set state to 10

endif
endif
endif
end VampireCheck
User avatar
Tiffany Carter
 
Posts: 3454
Joined: Wed Jul 19, 2006 4:05 am

Post » Sat Jun 23, 2012 6:18 am

As you don't say what is not working as expected and don't give error messages, it is difficult to help.
Try putting debugging messagebox after each if condition to see if logic is correct, e.g.
if ( player->GetSpell "werewolf blood red" == 1 )    MessageBox "spell detected"    Set wereclan to 1
I think you have a extra last endif, maybe it does not cause problems but it is wrong so better fix it anyway (by the way, http://webpages.charter.net/manauser/morrowind/indenter.htm helps finding if structure errors)
Other than this, verify to have "werewolf blood Crimson" spell and wereclan global variable defined...
Maybe get MWEdit and learn how to use it to check scripts syntax, it may help catching things that the Construction Set can't see
User avatar
Prohibited
 
Posts: 3293
Joined: Tue Jun 12, 2007 6:13 am


Return to III - Morrowind