Difference between revisions of "Talk:Script Processing"

2,521 bytes added ,  16:16, 9 November 2007
Problem with specific assertions
imported>Abramul
imported>HawkFest
(Problem with specific assertions)
 
Is it necessary that an actor have one or more AI packages in order for a script on that actor to run when the player is in a different cell? [[User:Abramul|Abramul]] 12:27, 5 April 2007 (EDT)
 
== Problem with specific assertions ==
 
[Quote]# Scripts on references: processed every frame when its cell is loaded, not at all when the cell is not loaded. So these scripts run only when the player is nearby (which means these are often a good place to put relatively expensive scripts, doing things like distance checks).[/quote]
 
I have a countainer in an interior cell linked by two doors with the IC Waterfront District, namely cells 02 and 03. Within that interior cell is a container using a non-persistent reference. However, '''its MenuMode block gets executed from the very begining - the first menu when entering the game, when no game is even loaded!'''... Any clue?
 
<pre>scn fjPCMStoneChestLarge1Script
Short CheckContainer
Begin OnLoad
If fjPCMGlobalStoneChestLarge1
pms fjPCMeffectStatueMarvels
Endif
End
 
;---*****
THE FOLLOWING BLOCK EXECUTES FROM THE VERY FIRST MENU, WHEN NO GAME IS EVEN LOADED!
Begin MenuMode ;--- Should be MenuMode 1008 for container Menu, but it does not work
Set CheckContainer to 1
message "Entered MenuMode..."
Return
End
;---*****
 
Begin OnReset ;--- Notify a Respawn Event
Set fjPCMGlobalStoneChestLarge1 to 1
; (... several sets and checks code ...)
Messagebox "You've aquired so much experience levels, that a new armament up to your persona is at hand. If you use the correct set of magic stopnes in the correct order inside the Stand of Marvels in your Magic Room, a new Lord's Armor Set of Marvels will respawn. Watch out for Bubo and Siomo!"
End
 
Begin GameMode
If CheckContainer
Set CheckContainer to 0
Message "Verifying the Star Dust Receptacle's Inventory...",4
if (GetItemCount fjPCMArmorMarvelousGreavesLvl1 > 0) || (GetItemCount fjPCMArmorMarvelousGreavesLvl5 > 0) || (GetItemCount fjPCMArmorMarvelousGreavesLvl11 > 0) || (GetItemCount fjPCMArmorMarvelousGreavesLvl16 > 0) || (GetItemCount fjPCMArmorMarvelousGreavesLvl21 > 0) || (GetItemCount fjPCMArmorMarvelousGreavesLvl27 > 0)
Set fjPCMGlobalStoneChestLarge1 to 1
pms fjPCMeffectStatueMarvels
Else
Set fjPCMGlobalStoneChestLarge1 to 0
sms fjPCMeffectStatueMarvels
Endif
Endif
End
</pre>
 
[Quote]# Scripts on objects in containers: these are processed when the container's script is processed -- so, items on actors are processed when the actor is processed; items in other containers are processed every frame '''when the cell is loaded'''.[/Quote]
''When the cell is loaded'' is not correct in regards to the above-mentioned oddity. It needs to be clarified IMHO...
Anonymous user