Wolvman's Scripting Questions

Post » Thu Jan 14, 2010 12:29 pm

Well here's the complete code. It's used to allow the player to change into a werewolf at will if their character has at least a willpower level of 80. As the willpower level increases the duration they can stay a werewolf grows. Then at a randomized time it forces them to change back into a human. Right now my script is setup to use real-life seconds for the timers, and it works perfectly so far. The only thing is, I would like for it to use in-game hours that work for whatever the player has set their timescale too. That way it ensures that it matches everyone's game setup better than just using real-life seconds.


Begin Were_ChangeAtWillScript	short state	short pcwere	short oldpcwere	float timer	short KeyRef	short DoOnce	short DoOnce2	Long Code	Long Current	short randomizer	;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 80-85;;;;;;;;;;;;;;;;;;;;;	If ( DoOnce2 == 1 )		If ( randomizer == 1 )			If ( player-> getwillpower >= 80 ) 				If ( player-> getwillpower < 85 ) 									if ( timer <= 60 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 2 )			If ( player-> getwillpower >= 80 ) 				If ( player-> getwillpower <= 85 ) 						if ( timer <= 180 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 3 )			If ( player-> getwillpower >= 80 ) 				If ( player-> getwillpower <= 85 ) 					if ( timer <= 140 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 4 )			If ( player-> getwillpower >= 80 ) 				If ( player-> getwillpower <= 85 ) 					if ( timer <= 300 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 5 )			If ( player-> getwillpower >= 80 ) 				If ( player-> getwillpower <= 85 ) 					if ( timer <= 360 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 86-90;;;;;;;;;;;;;;;;;;;;;	If ( DoOnce2 == 1 )		If ( randomizer == 1 )			If ( player-> getwillpower > 85 ) 				If ( player-> getwillpower <= 90 ) 					if ( timer <= 400 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 2 )			If ( player-> getwillpower > 85 ) 				If ( player-> getwillpower <= 90 ) 					if ( timer <= 460 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 3 )			If ( player-> getwillpower > 85 ) 				If ( player-> getwillpower <= 90 ) 					if ( timer <= 310 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 4 )			If ( player-> getwillpower > 85 ) 				If ( player-> getwillpower <= 90 ) 					if ( timer <= 530 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 5 )			If ( player-> getwillpower > 85 ) 				If ( player-> getwillpower <= 90 ) 					if ( timer <= 620 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 91-95;;;;;;;;;;;;;;;;;;;;;	If ( DoOnce2 == 1 )		If ( randomizer == 1 )			If ( player-> getwillpower > 90 ) 				If ( player-> getwillpower <= 95 ) 					if ( timer <= 640 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 2 )			If ( player-> getwillpower > 90 ) 				If ( player-> getwillpower <= 95 ) 					if ( timer <= 700 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 3 )			If ( player-> getwillpower > 90 ) 				If ( player-> getwillpower <= 95 ) 					if ( timer <= 500 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 4 )			If ( player-> getwillpower > 90 ) 				If ( player-> getwillpower <= 95 ) 					if ( timer <= 880 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 5 )			If ( player-> getwillpower > 90 ) 				If ( player-> getwillpower <= 95 ) 					if ( timer <= 940 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 96-99;;;;;;;;;;;;;;;;;;;;;	If ( DoOnce2 == 1 )		If ( randomizer == 1 )			If ( player-> getwillpower > 95 ) 				If ( player-> getwillpower <= 99 ) 					if ( timer <= 900 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 2 )			If ( player-> getwillpower > 95 ) 				If ( player-> getwillpower <= 99 ) 					if ( timer <= 1100 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 3 )			If ( player-> getwillpower > 95 ) 				If ( player-> getwillpower <= 99 ) 					if ( timer <= 700 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 4 )			If ( player-> getwillpower > 95 ) 				If ( player-> getwillpower <= 99 ) 					if ( timer <= 1600 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	If ( DoOnce2 == 1 )		If ( randomizer == 5 )			If ( player-> getwillpower > 95 ) 				If ( player-> getwillpower <= 99 ) 					if ( timer <= 1800 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0						set randomizer to random 5					endif				endif			endif		endif	endif	;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 100+;;;;;;;;;;;;;;;;;;;;;	If ( DoOnce2 == 1 )			If ( player-> getwillpower >= 100 ) 					if ( timer <= 2500 )						set timer to ( timer + GetSecondsPassed )					else				set PCWerewolf to 1						startscript, "Were_BecomeHuman"						set timer to 0						set DoOnce2 to 0					endif				endif			endif	;;;;;;;;;;;;;;;;;;;;;;End of Uncontrollable Transformations;;;;;;;;;;;;;;;;;;;;;	if ( RanConfig == 0 )		return	endif	Set Code to Were_ChangeatWillActivateKey	Setx Current to xKeyPressed, Code	if ( player-> getwillpower < 80 )		return	endif	if ( GetMasserPhase == 4 )		return	endif	;ADDED BY YACOBY ++++++++++++++++++++++++++++++++++++++++++++++	;if you want to make this compatible with other mods. Farily easy.	;all lines "player->becomeWerewolf" in this script are replaced by startscript, "Were_BecomeWerewolf"	;all lines "player->undoWerewolf" in this script are replaced by startscript, "Were_UndoWerewolf"	if ( scriptrunning, "Were_BecomeLycanthrope" )		return	elseif ( scriptrunning, "Were_BecomeHuman" )		return	endif	;END ADDED BY YACOBY ++++++++++++++++++++++++++++++++++++++++++++++	if ( menumode == 1 )		return	endif	if ( Current == 0 )		if ( DoOnce == 1 )			set DoOnce to 0		endif		return	endif	if ( DoOnce == 1 )		return	endif	set DoOnce to 1	;________________BEGIN CHANGE INTO WEREWOLF____________________	If ( DoOnce2 == 0 )		if ( MenuMode == 0 )			if ( PCWerewolf == 1 )				set PCWerewolf to -2			endif			startscript, "Were_BecomeLycanthrope"			Removespell, "Were_Humanbuff"			player->AddSpell "werewolf regeneration"			Set DoOnce2 to 1			set randomizer to random 5			Return		Endif	Endif	;________________END CHANGE INTO WEREWOLF__________________	;______________BEGIN CHANGE OUT OF WEREWOLF________________	If ( DoOnce2 == 1 )		if ( MenuMode == 0 )			startscript, "Were_BecomeHuman"			Player->RemoveSpell "werewolf regeneration"			if ( PCWerewolf == -2 )				set PCWerewolf to 1			endif			Set DoOnce2 to 0			set timer to 0			Return		Endif	endif	;_______________END CHANGE OUT OF WEREWOLF__________________end


I'm going to look at your changes and additions to the code in a bit and see what I can get working. Thanks for the help cyran. If you think of a more reliable way for this to work I'm all ears.
User avatar
Emmi Coolahan
 
Posts: 3335
Joined: Wed Jan 24, 2007 9:14 pm

Post » Thu Jan 14, 2010 3:17 pm

Fair enough reason to consult Gamehour. It appears that even if this is a local script it is on an object that the player will have in his/her possession so I will assume that it runs all of the time.

This is what I am talking about with regard to efficient coding:

Begin Were_ChangeAtWillScriptshort stateshort pcwereshort oldpcwerefloat timershort keyRefshort doOnceshort doOnce2long codelong currentshort randomizerfloat targetHourshort currentDayif ( player-> getwillpower < 80 ); resolve this early   returnendifif ( GetMasserPhase == 4 ); ...and this as well   returnendifif ( doOnce2 == 1 )   if ( player->GetWillpower < 85 ); lower boundary already covered above	  if ( randomizer == 0 ); Random 5 returns value between 0 and 4		 set targetHour to ( Gamehour + 0.500 ); 60 second equivalent	  elseif ( randomizer == 1 )		 set targetHour to ( Gamehour + 1.500 ); 180 second equivalent	  elseif ( randomizer == 2 )		 set targetHour to ( Gamehour + 1.167 ); 140 second equivalent	  elseif ( randomizer == 3 )		 set targetHour to ( Gamehour + 2.500 ); 300 second equivalent	  elseif ( randomizer == 4 )		 set targetHour to ( Gamehour + 3.000 ); 360 second equivalent	  endif   elseif ( player->GetWillpower < 90 ) 	  if ( randomizer == 0 ) 		 set targetHour to ( Gamehour + 3.333 ); 400 second equivalent	  elseif ( randomizer == 1 )		 set targetHour to ( Gamehour + 3.833 ); 460 second equivalent	  elseif ( randomizer == 2 )		 set targetHour to ( Gamehour + 2.583 ); 310 second equivalent	  elseif ( randomizer == 3 )		 set targetHour to ( Gamehour + 4.417 ); 530 second equivalent	  elseif ( randomizer == 4 )		 set targetHour to ( Gamehour + 5.167 ); 620 second equivalent	  endif   elseif ( player->GetWillpower < 95 ) 	  if ( randomizer == 0 ) 		 set targetHour to ( Gamehour + 5.333 ); 640 second equivalent	  elseif ( randomizer == 1 )		 set targetHour to ( Gamehour + 5.833 ); 700 second equivalent	  elseif ( randomizer == 2 )		 set targetHour to ( Gamehour + 4.167 ); 500 second equivalent	  elseif ( randomizer == 3 )		 set targetHour to ( Gamehour + 7.333 ); 880 second equivalent	  elseif ( randomizer == 4 )		 set targetHour to ( Gamehour + 7.833 ); 940 second equivalent	  endif   elseif ( player->GetWillpower < 100 ) 	  if ( randomizer == 0 ) 		 set targetHour to ( Gamehour + 7.500 ); 900 second equivalent	  elseif ( randomizer == 1 )		 set targetHour to ( Gamehour + 9.167 ); 1100 second equivalent	  elseif ( randomizer == 2 )		 set targetHour to ( Gamehour + 5.833 ); 700 second equivalent	  elseif ( randomizer == 3 )		 set targetHour to ( Gamehour + 13.333 ); 1600 second equivalent	  elseif ( randomizer == 4 )		 set targetHour to ( Gamehour + 15.000 ); 1800 second equivalent	  endif   elseif ( player->GetWillpower >= 100 ) 	  set targetHour to ( Gamehour + 20.833 ); 2500 second equivalent   endif   set currentDay to Day   set doOnce2 to 2endifif ( doOnce2 == 2 ); checking time   if ( currentDay = Day )	  if ( targetHour > GameHour )		 return	  else		 set doOnce2 to 3; transform	  endif   else; next day	  if ( targetHour > ( GameHour + 24 ) )		 return	  else		 set doOnce2 to 3; transform	  endif   endifendifif ( doOnce2 == 3 )   set doOnce2 to 0   if ( ( ScriptRunning "Were_BecomeHuman" ) == 0 ); just to be safe	  StartScript "Were_BecomeHuman"   endif   set randomizer to Random 5; returns value between 0 and 4endif;;;;;;;;;;;;;;;;;;;;;;End of Uncontrollable Transformations;;;;;;;;;;;;;;;;;;;;;

I am not really certain what you have going on after this point (particularly the part where you check if ( doOnce2 == 1 ) again) so I will leave it alone.

You need to set currentDay to Day when you set doOnce2 to 1.
Edit: nevermind, I have that covered.

This code has not been tested.


Edit2: Oops, found a few typos (having difficulty getting my head around doOnce2).
User avatar
Loane
 
Posts: 3411
Joined: Wed Apr 04, 2007 6:35 am

Post » Thu Jan 14, 2010 11:07 pm

I just did a quick test of your new script and it seems to work perfectly. I can't thank you enough for those changes cyran.

I still have a question about the ingredients though (from the posts before this). Is there anyway that I can add a disease (lycanthropy) to the player when they eat an ingredient?
User avatar
Quick Draw III
 
Posts: 3372
Joined: Sat Oct 20, 2007 6:27 am

Post » Fri Jan 15, 2010 1:05 am

I am a little surprised it worked since I just caught a couple typos (I typed doOnce 2 instead of doOnce2). Perhaps you caught that when compiling the script.

As for detecting when the player has eaten an ingredient that could be very problematic. If it is a unique (new) item, you can script it for an OnPCEquip check with a PCSkipEquip. When the player attempts to eat the ingredient, a global script is started that removed the (uneaten) ingredient and adds the disease (spell) of your choice. If this is an existing ingredient, I would be very wary of adding a script to it. Perhaps a script extender would be helpful in such a case. The only workaround I can think of is to have a script continuously check and store the amount of that ingredient in the player's inventory and then look for a change whenever the sound for ingesting an ingredient plays (presumably) a change in the count would be due to the player eating the ingredient and not dropping it, placing it in a container or selling it. It is a kludge that might not work (sound detection is not the most reliable thing you can do). That is the only idea I have off-hand.
User avatar
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Thu Jan 14, 2010 6:32 pm

Couldn't you just do a getspell thing going? Like, put an alchemy affect on the ingredient and then check for when the player has the name of the spell on his/her ability lineup thing (am I making any sense?), then script a removal of the alchemic property spell and add the disease through that way.

Incidentally, couldn't you just put the disease's spell onto the ingredient (never tried it), but I'm not really sure how diseases work. Kinda how vampire dust has the vampirism spell effect on it, but with just the name of the disease (saenus lupinus, for example).

I'm pretty fresh meat to this whole modding concept though, so take it with a grain of salt.
User avatar
Jordan Fletcher
 
Posts: 3355
Joined: Tue Oct 16, 2007 5:27 am

Post » Fri Jan 15, 2010 1:54 am

Well, I got the ingredients to work finally, but now I'm having troubles with the change-at-will scripts again. It seems that only the first part of that script you wrote (cyran0) works, but if the player has a willpower that is higher than 84 it stops working. So for some reason it's getting blocked out after the first section of the script.
User avatar
Sierra Ritsuka
 
Posts: 3506
Joined: Mon Dec 11, 2006 7:56 am

Post » Thu Jan 14, 2010 11:12 am

It is a little unclear what portions of the script you are referring to, but if my code is 'the first part of the script' then it is working very much as expected - perhaps not as you wanted.

When doOnce2 == 1, the player's willpower is consulted and if 85 or greater a duration is assigned and doOnce2 is set to 2. Until the duration of the spell effect has elapsed the if ( doOnce2 == 2 ) block of code returns preventing any of the following instructions (that which my code does not alter) from being executed. If you have code below my changes that need to be checked every frame, just move it above my code (at least above if ( doOnce2 == 2 )) or remove the 'returns' I introduced for efficiency sake. The reason I did not incorporate your remaining code into my script is that I did not understand well enough what it was trying to accomplish.
User avatar
Jessica Nash
 
Posts: 3424
Joined: Tue Dec 19, 2006 10:18 pm

Post » Thu Jan 14, 2010 1:33 pm

Sorry, I was pretty unclear about the sections of code I was referring to. Currently this is the issue I'm running into. I found that putting your code anywhere in the Begin Were_ChangeatWill script blocked out the other parts from being reached (those parts that you were unsure about). So I decided to make two separate scripts that activate each other. This one:
Begin SnowWere_ChangeAtWillScript	short state	short pcwere	short oldpcwere	float timer	short keyRef	short doOnce	short doOnce2	long code	long current	short randomizer	float targetHour	short currentDay	if ( player->getwillpower < 80 ); resolve this early		return	endif	if ( GetMasserPhase == 4 ); ...and this as well		return	endif	if ( RanConfig == 0 )		return	endif	if ( menumode == 1 )		return	endif;ADDED BY YACOBY ++++++++++++++++++++++++++++++++++++++++++++++;if you want to make this compatible with other mods. Farily easy.;all lines "player->becomeWerewolf" in this script are replaced by startscript, "Were_BecomeWerewolf";all lines "player->undoWerewolf" in this script are replaced by startscript, "Were_UndoWerewolf"	if ( scriptrunning, "Were_BecomeLycanthrope" )		return	elseif ( scriptrunning, "Were_BecomeHuman" )		return	endif;END ADDED BY YACOBY +++++++++++++++++++++++++++++++++++++++++++++	Set Code to Were_ChangeatWillActivateKey	Setx Current to xKeyPressed, Code	if ( Current == 0 )		if ( DoOnce == 1 )			set DoOnce to 0		endif		return	endif	if ( DoOnce == 1 )		return	endif	set DoOnce to 1;________________BEGIN CHANGE INTO WEREWOLF____________________		If ( DoOnce2 == 0 )		if ( MenuMode == 0 )			startscript, "Were_BecomeLycanthrope"			StartScript, "SnowWere_CaWRandomizer"			player->AddSpell "werewolf regeneration"			if ( PCSnowWerewolf == 1 )				set PCSnowWerewolf to -2			endif				set DoOnce2 to 1	set randomizer to random 5			Return		Endif	Endif;________________END CHANGE INTO WEREWOLF__________________;______________BEGIN CHANGE OUT OF WEREWOLF________________	 If ( DoOnce2 == 1 )		if ( MenuMode == 0 )			startscript, "Were_BecomeHuman"			StopScript, "SnowWere_CaWRandomizer"			Player->RemoveSpell "werewolf regeneration"			if ( PCSnowWerewolf == -2 )				set PCSnowWerewolf to 1			endif				set DoOnce2 to 0	set randomizer to random 5			Return		Endif	endif;_______________END CHANGE OUT OF WEREWOLF__________________end


Which simply allows the player to push a certain button to activate the transformation. Note: This is the script for the snow werewolves, not the black werewolves which is what the earlier scripts we were messing with were for (meaning there are some small name changes in some of the code). Then on activation of the button when the player is changing from a human to a werewolf it starts this script:


Begin SnowWere_CaWRandomizershort doOnceshort randomizerfloat targetHourshort currentDay	if ( doOnce == 0 )		set randomizer to Random 5; returns value between 0 and 4		if ( player->GetWillpower <= 85 ); lower boundary already covered above			messagebox "First"			if ( randomizer == 0 ); Random 5 returns value between 0 and 4				set targetHour to ( Gamehour + 0.500 ); 60 second equivalent			elseif ( randomizer == 1 )				set targetHour to ( Gamehour + 1.500 ); 180 second equivalent			elseif ( randomizer == 2 )				set targetHour to ( Gamehour + 1.167 ); 140 second equivalent			elseif ( randomizer == 3 )				set targetHour to ( Gamehour + 2.500 ); 300 second equivalent			elseif ( randomizer == 4 )				set targetHour to ( Gamehour + 3.000 ); 360 second equivalent			endif		endif	endif	if ( doOnce == 0 )		if ( player->GetWillpower > 85 )			if ( player->GetWillpower <= 90 )				set randomizer to Random 5; returns value between 0 and 4				messagebox "Second"				if ( randomizer == 0 )					set targetHour to ( Gamehour + 3.333 ); 400 second equivalent				elseif ( randomizer == 1 )					set targetHour to ( Gamehour + 3.833 ); 460 second equivalent				elseif ( randomizer == 2 )					set targetHour to ( Gamehour + 2.583 ); 310 second equivalent				elseif ( randomizer == 3 )					set targetHour to ( Gamehour + 4.417 ); 530 second equivalent				elseif ( randomizer == 4 )					set targetHour to ( Gamehour + 5.167 ); 620 second equivalent				endif			endif		endif	endif	if ( doOnce == 0 )		if ( player->GetWillpower > 90 )			if ( player->GetWillpower <= 95 )				set randomizer to Random 5; returns value between 0 and 4				messagebox "Third"				if ( randomizer == 0 )					set targetHour to ( Gamehour + 5.333 ); 640 second equivalent				elseif ( randomizer == 1 )					set targetHour to ( Gamehour + 5.833 ); 700 second equivalent				elseif ( randomizer == 2 )					set targetHour to ( Gamehour + 4.167 ); 500 second equivalent				elseif ( randomizer == 3 )					set targetHour to ( Gamehour + 7.333 ); 880 second equivalent				elseif ( randomizer == 4 )					set targetHour to ( Gamehour + 7.833 ); 940 second equivalent				endif			endif		endif	endif	if ( doOnce == 0 )		if ( player->GetWillpower > 95 )			if ( player->GetWillpower < 100 )				set randomizer to Random 5; returns value between 0 and 4				messagebox "Fourth"				if ( randomizer == 0 )					set targetHour to ( Gamehour + 7.500 ); 900 second equivalent				elseif ( randomizer == 1 )					set targetHour to ( Gamehour + 9.167 ); 1100 second equivalent				elseif ( randomizer == 2 )					set targetHour to ( Gamehour + 5.833 ); 700 second equivalent				elseif ( randomizer == 3 )					set targetHour to ( Gamehour + 13.333 ); 1600 second equivalent				elseif ( randomizer == 4 )					set targetHour to ( Gamehour + 15.000 ); 1800 second equivalent				endif			endif		endif	endif	if ( doOnce == 0 )		if ( player->GetWillpower >= 100 )			set randomizer to Random 5; returns value between 0 and 4			messagebox "Fifth"			set targetHour to ( Gamehour + 20.833 ); 2500 second equivalent		endif		set currentDay to Day		set doOnce to 1	endif	if ( doOnce == 1 ); checking time		if ( currentDay == Day )			if ( targetHour > GameHour )				return			else				set doOnce to 2; transform			endif		else; next day			if ( targetHour > GameHour + 24 )				return			else				set doOnce to 2; transform			endif		endif	endif	if ( doOnce == 2 )		if ( ( ScriptRunning "Were_BecomeHuman" ) == 0 ); just to be safe			WakeUpPC			StartScript "Were_BecomeHuman"		endif		set randomizer to Random 5; returns value between 0 and 4		set doOnce to 0		fadeout 4		stopscript, "SnowWere_CaWRandomizer"	endif;;;;;;;;;;;;;;;;;;;;;;End of Uncontrollable Transformations;;;;;;;;;;;;;;;;;;;;;End


Which is a slightly modified version of your code. I changed the elseifs to endifs just to see if it would change anything. It did, but it still didn't fix the problem all the way. I also put messageboxes in just to see how far along the code was reading. For some reason the script seems to be reaching each of the different sections (by which I mean the different getwillpower parts) just fine, but only if I remove the elseifs from the code. With the esleifs left in, it only reads up to the first section. However, neither way seems to be working past the first part for actually forcing the player the transform back by starting the "Were_BecomeHuman" script. So to sum up the problem again, the code only seems to be forcing the transformations when the player has a willpower lower than 86. I'm needing it to work for each of the different willpower levels.
User avatar
Julia Schwalbe
 
Posts: 3557
Joined: Wed Apr 11, 2007 3:02 pm

Post » Thu Jan 14, 2010 1:38 pm

Well, I'm still in need of some help for the change-at-will scripts but I also have one other small problem.

The new ingredients that I made aren't stacking correctly anymore in the player's inventory, and I'm wondering how to fix this. I believe it's because I attached scripts to each of them, but I'm not sure if that is causing it.
User avatar
Richus Dude
 
Posts: 3381
Joined: Fri Jun 16, 2006 1:17 am

Post » Thu Jan 14, 2010 5:14 pm

If I had anything useful to offer I would have posted sooner. I have examined your new code and my original script (several times) and I can see no reason why it would not perform exactly as intended. Perhaps I am overlooking something, but it may require a fresh set of eyes to see it.

As for your non-staking ingredients, yes the script you added to them is exactly the reason they do not stack anymore. The only fix is to come up with a workaround that will not require a script on the ingredient. If the script is part of a scheme to detect when the player ingests the ingredient then that will be very difficult to circumvent (refer to my post #29).
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm

Post » Thu Jan 14, 2010 9:41 pm

Well maybe this will help. I've made some changes to the script again and it everything in it seems to working fine, except for one thing. Luckily I've narrowed the problem down.

Begin SnowWere_CaWRandomizer	short randomizer	float targetHour	short currentDay	if ( CaWRandomizer == 1 ); checking time		if ( currentDay == Day )			if ( targetHour > GameHour )				return			elseif ( targetHour < GameHour )				set CaWRandomizer to 2; transform				return			endif		else; next day			if ( targetHour > GameHour + 24 )				return			else				set CaWRandomizer to 2; transform			endif		endif	endif	if ( CaWRandomizer == 2 )		if ( ScriptRunning "Were_BecomeHuman"  == 0 ); just to be safe			WakeUpPC			StartScript "Were_BecomeHuman"			fadeout 4		endif		set randomizer to Random 5; returns value between 0 and 4		set CaWRandomizer to 0		if ( PCSnowWerewolf == -2 )			set PCSnowWerewolf to 1			fadeout 4		endif		stopscript, "SnowWere_CaWRandomizer"	endif	if ( CaWRandomizer == 0 )		set randomizer to Random 5; returns value between 0 and 4		if ( player->GetWillpower < 85 ); lower boundary already covered above			if ( randomizer == 0 ); Random 5 returns value between 0 and 4				set targetHour to ( Gamehour + 1.000 ); 60 second equivalent			elseif ( randomizer == 1 )				set targetHour to ( Gamehour + 1.500 ); 180 second equivalent			elseif ( randomizer == 2 )				set targetHour to ( Gamehour + 2.000 ); 140 second equivalent			elseif ( randomizer == 3 )				set targetHour to ( Gamehour + 3.500 ); 300 second equivalent			elseif ( randomizer == 4 )				set targetHour to ( Gamehour + 3.000 ); 360 second equivalent			endif		Elseif ( player->GetWillpower >= 85 )			if ( player->GetWillpower < 90 )				set randomizer to Random 5; returns value between 0 and 4				if ( randomizer == 0 )					set targetHour to ( Gamehour + 3.000 ); 400 second equivalent				elseif ( randomizer == 1 )					set targetHour to ( Gamehour + 7.500 ); 460 second equivalent				elseif ( randomizer == 2 )					set targetHour to ( Gamehour + 4.000 ); 310 second equivalent				elseif ( randomizer == 3 )					set targetHour to ( Gamehour + 6.500 ); 530 second equivalent				elseif ( randomizer == 4 )					set targetHour to ( Gamehour + 5.000 ); 620 second equivalent				endif			endif		Elseif ( player->GetWillpower >= 90 )			if ( player->GetWillpower < 95 )				set randomizer to Random 5; returns value between 0 and 4				if ( randomizer == 0 )					set targetHour to ( Gamehour + 10.000 ); 640 second equivalent				elseif ( randomizer == 1 )					set targetHour to ( Gamehour + 8.000 ); 700 second equivalent				elseif ( randomizer == 2 )					set targetHour to ( Gamehour + 6.000 ); 500 second equivalent				elseif ( randomizer == 3 )					set targetHour to ( Gamehour + 8.500 ); 880 second equivalent				elseif ( randomizer == 4 )					set targetHour to ( Gamehour + 7.000 ); 940 second equivalent				endif			endif		Elseif ( player->GetWillpower >= 95 )			if ( player->GetWillpower < 100 )				set randomizer to Random 5; returns value between 0 and 4				if ( randomizer == 0 )					set targetHour to ( Gamehour + 18.000 ); 900 second equivalent				elseif ( randomizer == 1 )					set targetHour to ( Gamehour + 7.500 ); 1100 second equivalent				elseif ( randomizer == 2 )					set targetHour to ( Gamehour + 8.000 ); 700 second equivalent				elseif ( randomizer == 3 )					set targetHour to ( Gamehour + 13.500 ); 1600 second equivalent				elseif ( randomizer == 4 )					set targetHour to ( Gamehour + 15.000 ); 1800 second equivalent				endif			endif		Elseif ( player->GetWillpower >= 100 )			set targetHour to ( Gamehour + 22 ); 2500 second equivalent		endif		set currentDay to Day		set CaWRandomizer to 1		return	endif;;;;;;;;;;;;;;;;;;;;;;End of Uncontrollable Transformations;;;;;;;;;;;;;;;;;;;;;End


The problem now lies with the the times bleeding over into the next day. If that happens at all, the code stops working correctly. If the player transforms at say 11:00 pm, and then is supposed to transform back 3 hours later it does absolutely nothing because it goes past 12:00 into the next day. Also if the timer extends past 12:00 AM from the start it automatically skips to the if ( CaWRandomizer == 2 ) section and forces an immediate transformation back into a human. An example would be for the 100+ willpower setting if it is 5:00 AM when the player pushes the Change-at-will button.

So basically the problem is caused by this part of the script:
	if ( CaWRandomizer == 1 ); checking time		if ( currentDay == Day )			if ( targetHour > GameHour )				return			elseif ( targetHour < GameHour )				set CaWRandomizer to 2; transform				return			endif		else; next day			if ( targetHour > GameHour + 24 )				return			else				set CaWRandomizer to 2; transform			endif		endif	endif


Any idea how to make it work for the next day as well?
User avatar
krystal sowten
 
Posts: 3367
Joined: Fri Mar 09, 2007 6:25 pm

Post » Thu Jan 14, 2010 4:05 pm

It was designed to deal with the case that the spell lasts into the next day. However, you have not made it clear if this script will run continuously, or if the player could leave the cell in which the script is running. If the latter you could run into some second day issues. Assuming it runs continuously then logically is should work, but there might be a problem with adding 24 to GameHour (the game engine could simplify it to return a value between 0 and 24).

Try:

if ( CaWRandomizer == 1 ); checking time	if ( currentDay == Day )		if ( targetHour > GameHour )			return		elseif ( targetHour < GameHour )			set CaWRandomizer to 2; transform			return		endif	else; next day		if ( Gamehour < ( targetHour - 24 ) ); this line was re-written			return		else			set CaWRandomizer to 2; transform		endif	endifendif

User avatar
Jessie
 
Posts: 3343
Joined: Sat Oct 14, 2006 2:54 am

Post » Thu Jan 14, 2010 2:29 pm

Well so far your script changes above are working the best. But it's still having issues with the script not working if the time limit passes either 12 P.M. or 12 A.M. Also this script does run constantly but only as long as the player is a werewolf via Change-At-Will, and the player will most likely be running through different cells while the script is running.

I lowered the times for all of the possible targetHours in the script to see if that might help. I left the highest one (100+ willpower) at 9 hours instead of it's earlier 22 hours, and it seemed to help up until it had to pass 12 A.M. or 12 P.M. So the only problem I see with the script now is when it bleeds into the next 12 O'Clock.

Btw, thanks again for taking the time to help me with all of this Cyran.
User avatar
Dezzeh
 
Posts: 3414
Joined: Sat Jun 16, 2007 2:49 am

Post » Thu Jan 14, 2010 10:37 pm

I think I have it this time. The insight of my last post was applied only to the part of script that you highlighted. In the main body of the script I am setting targetHour to Gamehour + a constant. If I am correct and the engine converts that to a value between 0 and 24, this could account for the transformation not running as long as it should. Here is a revision that sidesteps that possibility:

Begin SnowWere_CaWRandomizershort randomizerfloat targetHourshort currentDayif ( CaWRandomizer == 1 ); checking time	if ( currentDay == Day )		if ( targetHour > GameHour )			return		elseif ( targetHour < GameHour )			set CaWRandomizer to 2; transform			return		endif	else; next day		if ( Gamehour < ( targetHour - 24 ) )			return		else			set CaWRandomizer to 2; transform		endif	endifendifif ( CaWRandomizer == 2 )	if ( ScriptRunning "Were_BecomeHuman"  == 0 ); just to be safe		WakeUpPC		StartScript "Were_BecomeHuman"		fadeout 4	endif	set randomizer to Random 5; returns value between 0 and 4	set CaWRandomizer to 0	if ( PCSnowWerewolf == -2 )		set PCSnowWerewolf to 1		fadeout 4	endif	stopscript, "SnowWere_CaWRandomizer"endifif ( CaWRandomizer == 0 )	set randomizer to Random 5; returns value between 0 and 4; covers all cases	set targetHour to Gamehour ); this will be necessary for all cases	if ( player->GetWillpower < 85 ); lower boundary already covered above		if ( randomizer == 0 ); Random 5 returns value between 0 and 4			set targetHour to ( targetHour + 1.000 ); 60 second equivalent		elseif ( randomizer == 1 )			set targetHour to ( targetHour + 1.500 ); 180 second equivalent		elseif ( randomizer == 2 )			set targetHour to (targetHour + 2.000 ); 140 second equivalent		elseif ( randomizer == 3 )			set targetHour to (targetHour + 3.500 ); 300 second equivalent		elseif ( randomizer == 4 )			set targetHour to (targetHour + 3.000 ); 360 second equivalent		endif	elseif ( player->GetWillpower >= 85 )		if ( player->GetWillpower < 90 );		   set randomizer to Random 5; returns value between 0 and 4; this is unnecessary			if ( randomizer == 0 )				set targetHour to (targetHour + 3.000 ); 400 second equivalent			elseif ( randomizer == 1 )				set targetHour to (targetHour + 7.500 ); 460 second equivalent			elseif ( randomizer == 2 )				set targetHour to (targetHour + 4.000 ); 310 second equivalent			elseif ( randomizer == 3 )			   set targetHour to (targetHour + 6.500 ); 530 second equivalent			elseif ( randomizer == 4 )				set targetHour to (targetHour + 5.000 ); 620 second equivalent			endif		endif	elseif ( player->GetWillpower >= 90 )		if ( player->GetWillpower < 95 );		   set randomizer to Random 5; returns value between 0 and 4; this is unnecessary			if ( randomizer == 0 )				set targetHour to (targetHour + 10.000 ); 640 second equivalent			elseif ( randomizer == 1 )				set targetHour to (targetHour + 8.000 ); 700 second equivalent			elseif ( randomizer == 2 )				set targetHour to (targetHour + 6.000 ); 500 second equivalent			elseif ( randomizer == 3 )				set targetHour to (targetHour + 8.500 ); 880 second equivalent			elseif ( randomizer == 4 )				set targetHour to (targetHour + 7.000 ); 940 second equivalent			endif		endif	elseif ( player->GetWillpower >= 95 )		if ( player->GetWillpower < 100 );		   set randomizer to Random 5; returns value between 0 and 4; this is unnecessary			if ( randomizer == 0 )				set targetHour to (targetHour + 18.000 ); 900 second equivalent			elseif ( randomizer == 1 )				set targetHour to (targetHour + 7.500 ); 1100 second equivalent			elseif ( randomizer == 2 )				set targetHour to (targetHour + 8.000 ); 700 second equivalent			elseif ( randomizer == 3 )				set targetHour to (targetHour + 13.500 ); 1600 second equivalent			elseif ( randomizer == 4 )				set targetHour to (targetHour + 15.000 ); 1800 second equivalent			endif		endif	elseif ( player->GetWillpower >= 100 )		set targetHour to (targetHour + 22 ); 2500 second equivalent	endif	set currentDay to Day	set CaWRandomizer to 1	returnendif;;;;;;;;;;;;;;;;;;;;;;End of Uncontrollable Transformations;;;;;;;;;;;;;;;;;;;;;End

User avatar
Lyndsey Bird
 
Posts: 3539
Joined: Sun Oct 22, 2006 2:57 am

Post » Thu Jan 14, 2010 9:13 pm

It's still having the same troubles it was having with the last script. I'm beginning to wonder if it has something to do the CurrentDay stuff.

I also checked the BM werewolf change script that forces you to turn at 9PM and 6AM. It seems that they are definitely using a 24 hour system. So 9PM is the 21st hour of the day while 6AM is actually the 6th hour. Not sure if you already knew that, but I think that means if the gamehour + targetHour ever generates a number above 24 the script doesn't know what to do with it.

Then again a script like this may not even be possible with MW.
User avatar
+++CAZZY
 
Posts: 3403
Joined: Wed Sep 13, 2006 1:04 pm

Post » Thu Jan 14, 2010 4:00 pm

I have just tested the last script I posted with messageboxes informing me of when the transformation begun and when it was expected to end. Upon conclusion another messagebox reports the current time and reminds me of when transformation should have ended. I tested numerous trials across the noon and midnight meridians and the script worked exactly as expected - it ran the full duration before concluding. I have to conclude that something else is causing the early termination of your transformation.

I suspect that you have another script that is assigning a value to the global variable CaWRandomizer. I am not certain why this needs to be a global, a local variable would be more efficient and safer. If another script sets the value of CaWRandomizer to 2 before SnowWere_CaWRandomizer does, the transformation back to human would occur prematurely. Perhaps this other script is setting CaWRandomizer to 2 at Gamehour == 12 and Gamehour == 24.
User avatar
katie TWAVA
 
Posts: 3452
Joined: Tue Jul 04, 2006 3:32 am

Post » Thu Jan 14, 2010 9:03 pm

The only other script that touches CaWRandomizer at all is this one:

Begin SnowWere_ChangeAtWillScript	short state	short pcwere	short oldpcwere	float timer	short keyRef	short doOnce	short doOnce2	long code	long current	float targetHour	short currentDay	if ( player->getwillpower < 80 ); resolve this early		return	endif	if ( GetMasserPhase == 4 ); ...and this as well		return	endif	if ( RanConfig == 0 )		return	endif	if ( menumode == 1 )		return	endif;ADDED BY YACOBY ++++++++++++++++++++++++++++++++++++++++++++++;if you want to make this compatible with other mods. Farily easy.;all lines "player->becomeWerewolf" in this script are replaced by startscript, "Were_BecomeWerewolf";all lines "player->undoWerewolf" in this script are replaced by startscript, "Were_UndoWerewolf"	if ( scriptrunning, "Were_BecomeLycanthrope" )		return	elseif ( scriptrunning, "Were_BecomeHuman" )		return	endif;END ADDED BY YACOBY +++++++++++++++++++++++++++++++++++++++++++++;Determines what button controls Changing-at-Will.	Set Code to Were_ChangeatWillActivateKey	Setx Current to xKeyPressed, Code;This little setup turns the button into a toggle rather than an infinate loop.	if ( Current == 0 )		if ( DoOnce == 1 )			set DoOnce to 0		endif		return	endif	if ( DoOnce == 1 )		return	endif	set DoOnce to 1;*First press of the button changes humans into lycanthropes*;________________BEGIN CHANGE INTO WEREWOLF____________________	if ( PCSnowWerewolf == 1 )		if ( MenuMode == 0 )			startscript, "Were_BecomeLycanthrope"			player->AddSpell "werewolf regeneration"			if ( PCSnowWerewolf == 1 )				set PCSnowWerewolf to -2			endif			StartScript, "SnowWere_CaWRandomizer"			Return		Endif	Endif;________________END CHANGE INTO WEREWOLF__________________;*Second press of the button changes lycanthropes back into humans*;______________BEGIN CHANGE OUT OF WEREWOLF________________		if ( PCSnowWerewolf == -2 )		if ( MenuMode == 0 )			startscript, "Were_BecomeHuman"			Player->RemoveSpell "werewolf regeneration"			if ( PCSnowWerewolf == -2 )				set PCSnowWerewolf to 1			endif			StopScript, "SnowWere_CaWRandomizer"				set CaWRandomizer to 0			Return		Endif	endif;_______________END CHANGE OUT OF WEREWOLF__________________end


Remember when I said that putting the other code into this one canceled out both because of the returns. So instead of putting them together into one script I had to separate them into two different scripts. This one simply controls the change-at-will through pressing a button. The other scripts handles the timers and gamehour for forcing the transformation back into a human after a certain amount of time. That's why I had to make CaWRandomizer a global so that if the player pushed the Change-at-Will button as a werewolf it could reset the timers of the second script, prepare them for the next time the player changed into a werewolf, and transform them back into a human through the button rather than the timers. I couldn't manage getting both the button and timers to work together in the same script. Still, even if I only press the button once in order to begin the whole process (from human to werewolf) it still has those problems reading the timers past 12AM or 12PM. So I'm getting the errors even without interference from the button script. What do you think I should do? :confused:
User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am

Post » Fri Jan 15, 2010 1:24 am

I have no idea what to recommend to you since the script should work (and does work). I cannot reproduce your problem. Having already made one bonehead mistake this morning I am particularly aware of the likelihood of 'pilot error'. I would encourage you to consider that you are overlooking something somewhere. Since I do not have the entirety of your mod to examine it is impossible for me to determine where that error originates. If you think it would be any service to you I can send you my test esp.
User avatar
Jessica Nash
 
Posts: 3424
Joined: Tue Dec 19, 2006 10:18 pm

Post » Fri Jan 15, 2010 2:29 am

Thank you, but it's not needed now. I finally managed to figure out what my problem was. The many different elseifs were causing a block in the script. Once I replaced them with endifs it worked all the way through. Anyways, I believe it's all working now so thanks again for the crazy amount of help you've been giving me.
User avatar
Cheville Thompson
 
Posts: 3404
Joined: Sun Mar 25, 2007 2:33 pm

Post » Thu Jan 14, 2010 1:19 pm

You are welcome. It is amazing just how convoluted the execution of a script can become for the sake of one misplaced elseif.
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Thu Jan 14, 2010 4:40 pm

Does anyone know how I can prevent NPC's from spawning except for full moons through scripts? This isn't for leveled lists if that matters at all.
User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am

Post » Fri Jan 15, 2010 1:36 am

In addition to my last question I have another one. Is there anyway to simply prevent the player from swinging their weapon when they click but still remain mobile (meaning without using disableplayercontrols). I'm pretty sure it's possible because I think the "Realistic Combat" mod did it and without using MWSE on top of that.
User avatar
Melanie Steinberg
 
Posts: 3365
Joined: Fri Apr 20, 2007 11:25 pm

Post » Thu Jan 14, 2010 8:48 pm

Does anyone know how I can prevent NPC's from spawning except for full moons through scripts? This isn't for leveled lists if that matters at all.

The commands you're looking for are GetMasserPhase (first moon) and GetSecundaPhase (second moon). Both will return the value of the moon phases for the last exterior Cell the player has visited.
begin Wolv_SpawnAtFullMoons_Script; This is set up as a local script for the NPC you wish to enable when both moons are full.if ( MenuMode == 1 )	returnendifif ( GetMasserPhase == 4 )	if ( GetSecundaPhase == 4 )		if ( GetDisabled == 1 )			Enable		endif	endifelse	if ( GetDisabled == 0 )		Disable	endifendifend

For more detailed information on these functions, please refer to http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=6083, p 144 f.
User avatar
Syaza Ramali
 
Posts: 3466
Joined: Wed Jan 24, 2007 10:46 am

Post » Fri Jan 15, 2010 12:42 am

Thank you bhl. I'll give it a shot in a little while to see how well it works.
User avatar
Sheila Esmailka
 
Posts: 3404
Joined: Wed Aug 22, 2007 2:31 am

Post » Thu Jan 14, 2010 6:01 pm

So I've been trying to figure out how to do a few things with this script. Basically my goal is to have it scare away most creatures that see the player in lycanthrope form, rather than standing there like they aren't about to get eaten :) . So far the script just follows the player around and constantly sets all of the creatures' flee values up without stopping. The problem is that it keeps going up forever way past 100 flee value. Also the creatures don't run away from the player on sight but rather only when in combat with the PC. So since I want them to run from the player whenever they see him I'm thinking I should have it automatically start combat with them after the player gets a certain distance away from them and there new flee values have been set. This way even the passive creatures will run away.

So to sum it up, how can I make this stop after changing each creatures flee value one time and what is the best method to get it to make them run away when they see the player. And if it helps at all currently this script starts when the player transforms into a lycanthrope and stops when the player turns back into a human.

Begin LycanthropeCreatureFear	long CreatureRef ;change the variables to whatever you want	long tmp	ifx ( CreatureRef )		setx CreatureRef to xNextRef CreatureRef ;finds the next NPC or creature in the cell	else		setx CreatureRef to xFirstNPC ;finds the first NPC or creature in the cell	endif	if ( CreatureRef == 0 )   ;end of list or empty cell		return	endif	setx tmp to CreatureRef->xRefType	if ( tmp != 1095062083 ) ;if not type Creature		return	endif	CreatureRef->ModFlee 50end

User avatar
Naomi Lastname
 
Posts: 3390
Joined: Mon Sep 25, 2006 9:21 am

PreviousNext

Return to III - Morrowind