Two scripts

Post » Sat Jan 02, 2010 6:12 am

Hello!
Do anybody know how to fix this bug in script:
ColonyAenar/ColonyHidar scripts only counts days that pass while you are in the area?
And same bug in Thirsk with profit at mead, script - SvenjaThirsk.
Time countdown ONLY if you in Thirsk, another no, so bug anolog to ColonyAenar/ColonyHidar scripts...
AzuMite help me with ColonyAenar script like this:
Spoiler
Begin ColonyAenar

;controls timing and variables for Stalhrim armor crafting
;also contains Journal update for killing all three nords in quest CO_8a

short OnPCHitMe
short scuirass
short sgreaves
short slpauld
short srpauld
short slbracer
short srbracer
short sboots
short shelm
short busy
short currentday
short localdayspassed
short nolore
short resetcurrentday ; Added by me

if ( busy == 1 )
if ( resetcurrentday != 1 )
set resetcurrentday to 1
set currentday to DaysPassed
elseif ( currentday != DaysPassed )
set localdayspassed to ( localdayspassed + DaysPassed - currentday )
set currentday to DaysPassed
endif
elseif ( resetcurrentday != 0 )
set resetcurrentday to 0
endif

if ( OnPCHitMe == 1 )
"Hidar"->SetFight 100
"Hidar"->StartCombat Player
"Graring"->SetFight 100
"Graring"->StartCombat Player
endif


End ColonyAenar

But...how to fix SvenjaThirsk and ColonyHidar?
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Sat Jan 02, 2010 4:32 am

Your day counter has to be in a separate global script because any scripts attached to NPCs will only be processed when the player is in the vicinity of that NPC. I would do a startscript under the busy block, but only run it once.
User avatar
Manuel rivera
 
Posts: 3395
Joined: Mon Sep 10, 2007 4:12 pm

Post » Sat Jan 02, 2010 9:37 am

assuming your posted script is working, this is what I'd try (untested)
[EDIT]browser hiccup
Begin ColonyHidar;controls timing and variables  for Stalhrim weapon smithing;also contains Journal update for killing all three nords in quest CO_8ashort OnPCHitMeshort s_axeshort s_waraxeshort s_daggershort s_swordshort s_maceshort localdayspassedshort currentdayshort busyshort noloreshort resetcurrentday ; Added by meif ( busy == 1 )	if ( resetcurrentday != 1 )		set resetcurrentday to 1		set currentday to DaysPassed	elseif ( currentday != DaysPassed )		set localdayspassed to ( localdayspassed + DaysPassed - currentday )		set currentday to DaysPassed	endifelseif ( resetcurrentday != 0 )	set resetcurrentday to 0endifif ( OnPCHitMe == 1 )	"Graring"->SetFight 100	"Graring"->StartCombat Player	"Aenar"->SetFight 100	"Aenar"->StartCombat PlayerendifEnd ColonyHidar

Begin SvenjaThirskShort MeadDeliveryShort CurrentDayShort LocaldaysPassedShort BusyShort NoLoreShort Changeshort resetcurrentday ; Added by meif ( busy == 1 )	if ( resetcurrentday != 1 )		set resetcurrentday to 1		set currentday to DaysPassed	elseif ( currentday != DaysPassed )		set localdayspassed to ( localdayspassed + DaysPassed - currentday )		set currentday to DaysPassed	endifelseif ( resetcurrentday != 0 )	set resetcurrentday to 0endifshort deadif ( dead )	returnendifif ( GetDisabled )	if ( GetJournalIndex "BM_MeadHall" >= 70 )		Enable	endif	returnendifif ( "svenja_outside"->GetHealth <= 0 )	Disable	set dead to 1	Returnendifif ( GetHealth > 0 )	if ( GetJournalIndex "BM_MeadHall" >= 40 )		if ( GetJournalIndex "BM_MeadHall" < 70 )			Disable		endif	endifendifEnd SvenjaThirsk

[EDIT2]Also, you may be insterested on global DaysPassed intricacies...
Spoiler
Once the script is compiled, variables aren't accessed by their name but by an internal index-number, thus the compiled scripts in a Tribunal mod and those in a non-Tribunal mod use different variables.

Dayspassed works fine with v1.0 - v1.2 (Vanilla Morrowind) You don't even need to declare it if you just want to read it. If you actually want to change the current day, you have to declare it, though. (Remember? I was the one who found this "hidden global" while working on Haldenshore two months before Tribunal came out...)

Dayspassed also works fine with v1.3 and v1.4 (Tribunal only) when your mod IS dependent on Tribunal.esm. No need to declare it.

The variable also works with v1.5 and v1.6 (Bloodmoon only, Tribunal NOT installed) as long as you declare it. It will no longer work when you don't declare the variable.

And finally it also works fine with v 1.5 and v1.6 (Tribunal AND Bloodmoon installed) as long as your mod IS dependent on Tribunal.esm. (No need to declare the variable)


So... when is Dayspassed NOT working or at least not reliable? Well, this happens with v1.3 - v1.6 when you HAVE Tribunal installed, but your mod IS NOT dependent on Tribunal.esm:

* If you don't declare the variable MW crashes or returns an left-eval error when you try to use it in the script (the Construction set accepts the script without problems)

* If you declare the variable in an ESP that is not dependent on Tribunal.esm, the script works but the Dayspassed-Variable that is used by your scripts will never be count up

* If you declare the variable in an ESM that is not dependent on Tribunal.esm, the Dayspassed-Variable from your mod is count up but the one used by Tribunal and Tribunal-dependent ESP's isn't.

* If another non-tribunal ESM declares the variable, and this other mod has a later file-date than your own, then your mod will share Tribunal's fate, and the Dayspassed variable used by your scripts will also cease to work.



This post has been edited by JOG: Jun 14 2005, 05:00 PM

User avatar
Anna Beattie
 
Posts: 3512
Joined: Sat Nov 11, 2006 4:59 am

Post » Sat Jan 02, 2010 4:15 am

assuming your posted script is working, this is what I'd try (untested)
[EDIT]browser hiccup
Begin ColonyHidar;controls timing and variables  for Stalhrim weapon smithing;also contains Journal update for killing all three nords in quest CO_8ashort OnPCHitMeshort s_axeshort s_waraxeshort s_daggershort s_swordshort s_maceshort localdayspassedshort currentdayshort busyshort noloreshort resetcurrentday ; Added by meif ( busy == 1 )	if ( resetcurrentday != 1 )		set resetcurrentday to 1		set currentday to DaysPassed	elseif ( currentday != DaysPassed )		set localdayspassed to ( localdayspassed + DaysPassed - currentday )		set currentday to DaysPassed	endifelseif ( resetcurrentday != 0 )	set resetcurrentday to 0endifif ( OnPCHitMe == 1 )	"Graring"->SetFight 100	"Graring"->StartCombat Player	"Aenar"->SetFight 100	"Aenar"->StartCombat PlayerendifEnd ColonyHidar

Begin SvenjaThirskShort MeadDeliveryShort CurrentDayShort LocaldaysPassedShort BusyShort NoLoreShort Changeshort resetcurrentday ; Added by meif ( busy == 1 )	if ( resetcurrentday != 1 )		set resetcurrentday to 1		set currentday to DaysPassed	elseif ( currentday != DaysPassed )		set localdayspassed to ( localdayspassed + DaysPassed - currentday )		set currentday to DaysPassed	endifelseif ( resetcurrentday != 0 )	set resetcurrentday to 0endifshort deadif ( dead )	returnendifif ( GetDisabled )	if ( GetJournalIndex "BM_MeadHall" >= 70 )		Enable	endif	returnendifif ( "svenja_outside"->GetHealth <= 0 )	Disable	set dead to 1	Returnendifif ( GetHealth > 0 )	if ( GetJournalIndex "BM_MeadHall" >= 40 )		if ( GetJournalIndex "BM_MeadHall" < 70 )			Disable		endif	endifendifEnd SvenjaThirsk

[EDIT2]Also, you may be insterested on global DaysPassed intricacies...
Spoiler


Thanks for script and info! I test this soon.
User avatar
Jessica Colville
 
Posts: 3349
Joined: Wed Oct 18, 2006 6:53 pm

Post » Sat Jan 02, 2010 12:56 pm

In MCP, autor turned off halfworked game function - adding to player plague desieŠ°ses in plague storm.
How to make global script, which add this desieŠ°ses? Need script anolog of halfworked game function)
User avatar
Monika
 
Posts: 3469
Joined: Wed Jan 10, 2007 7:50 pm


Return to III - Morrowind

cron