[RELz] Fallout Script Extender (FOSE) v1.1

Post » Wed Feb 10, 2010 10:15 pm

I'm having another problem, this time with formlists. What I want to do is add a reference to a formlist, but I can only do so from the console. If I try to use any of the formlist functions, the script will compile but the block will simply not run in-game. For example:

Begin GameMode    printc "1"    JerichoREF.ListAddReference MyFormList    printc "2"End

Neither of the console lines print, but they do if I comment out the ListAddReference call. I've tried every single relevant formlist function, in every way I can think of. I've tried it in a quest script with start game enabled, and I've tried doing it in an object script with the NPC standing in the cell next to me. Again, if I just open the console, target the NPC, and do ListAddReference MyFormList, it works fine.

Really frustrated. Please help.
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Thu Feb 11, 2010 2:29 am

Have you tried adding a doOnce guard to the script?

short doOnceBegin GameMode	if doOnce == 0		printc "1"		JerichoREF.ListAddReference MyFormList		set doOnce to 1		printc "2"	endifEnd


Also, you may need to use the base object ID for Jericho (to wit: Jericho), like below

short doOnceBegin GameMode	if doOnce == 0		printc "1"		Jericho.ListAddReference MyFormList		set doOnce to 1		printc "2"	endifEnd

User avatar
katsomaya Sanchez
 
Posts: 3368
Joined: Tue Jun 13, 2006 5:03 am

Post » Wed Feb 10, 2010 9:26 pm

Sorry, I'm a dork. While trying to figure out what was wrong I had switched from trying this with an NPC reference in another plugin to doing it with Jericho in Fallout.esm. It turns out my problem was mod isolation.
User avatar
JERMAINE VIDAURRI
 
Posts: 3382
Joined: Tue Dec 04, 2007 9:06 am

Post » Thu Feb 11, 2010 9:42 am

It's almost certainly due to a bug in the GECK compiler (carried over from TES:CS) which causes a buffer overrun when relatively long strings are passed as function arguments.
I am not at home at the moment so I can't check for possible solutions for you, but I will try to take a look in the near future.

Following up on this: I don't see any workarounds with the current version of FOSE, unfortunately. It will have to wait for a new version.
User avatar
~Sylvia~
 
Posts: 3474
Joined: Thu Dec 28, 2006 5:19 am

Post » Thu Feb 11, 2010 7:28 am

Following up on this: I don't see any workarounds with the current version of FOSE, unfortunately. It will have to wait for a new version.

Writing of a new version ... how is it comming?
User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Thu Feb 11, 2010 12:38 am

Following up on this: I don't see any workarounds with the current version of FOSE, unfortunately. It will have to wait for a new version.

Thanks. My workaround was to just pass the data in that trait up to the menu root. Makes for shorter strings and looks cleaner in scripts.
User avatar
Jerry Jr. Ortiz
 
Posts: 3457
Joined: Fri Nov 23, 2007 12:39 pm

Post » Thu Feb 11, 2010 7:26 am

I have a request, re: http://www.gamesas.com/bgsforums/index.php?showtopic=1055023.

Could you add the "con_tm" and "con_tfc" functions to FOSE?
User avatar
M!KkI
 
Posts: 3401
Joined: Sun Jul 16, 2006 7:50 am

Post » Thu Feb 11, 2010 4:27 am

Not sure how to delete posts. Oh boy...
User avatar
emma sweeney
 
Posts: 3396
Joined: Fri Sep 22, 2006 7:02 pm

Post » Thu Feb 11, 2010 9:53 am

Sorry if this is a stupid question, but when I run the fose loader is there any way it can pass an argument to fallout3.exe to run in a window that is maximized? Just a regular maximized window (with the window trim etc).
Thanks.
User avatar
Patrick Gordon
 
Posts: 3366
Joined: Thu May 31, 2007 5:38 am

Post » Thu Feb 11, 2010 12:19 am

How do SetMinRange and SetMaxRange work? When I use them from the console, the changes are applied to the target and other references to the same weapon. When I use them in scripts, the changes aren't reflected at all.

Edit: I seem to make a habit of asking a question, figuring it out for myself immediately after, and looking dumb. It only works if I create a reference of each item with PlaceAtMe, call the functions on the reference, then disable and delete it. Nice and elegant with arrays formlists.
User avatar
Ross
 
Posts: 3384
Joined: Thu Aug 10, 2006 7:22 pm

Post » Thu Feb 11, 2010 10:37 am

This is a re-post from a few months back since when I didn't play Fallout anymore for the below reason:


I have a very weird script/software-bug that has been trigggered so far by exiting the Brotherhood Tunnel to the Enclace Fortress (BOS) or by entering Paradise Falls.

The bug causes the immediate start of a script from the Dunwich building (so I guess: It teleports 3 Glowing Ones and 3 Centaurs slashing each other and everything around right next to me).
Worst: It triggers (drug mod based?) scripts, too, that is my screen turns extremely bright and zooms back to normal and does that add infinitum in a 4 seconds intervall. Needless to say that this renders the game unplayable.

The bug also occurs if I teleport myself there with the console.

Does anyone has any smart ideas what to do about this because I really would like to finish the game!
User avatar
Alexxxxxx
 
Posts: 3417
Joined: Mon Jul 31, 2006 10:55 am

Post » Thu Feb 11, 2010 12:44 am

Uhmm ... what makes you think this problem is FOSE related?

And if you think that it is not FOSE related, please start a new thread, including your load order (or a link to a previous thread with your then load order).
User avatar
Laura-Lee Gerwing
 
Posts: 3363
Joined: Fri Jan 12, 2007 12:46 am

Post » Thu Feb 11, 2010 5:32 am

Uhmm ... what makes you think this problem is FOSE related?

And if you think that it is not FOSE related, please start a new thread, including your load order (or a link to a previous thread with your then load order).


See, I don't know, however, since this is the number one thread about scripts, I was hoping that there's someone knowledgeable enough to tell me how to deal with the issue at hand in here.
User avatar
Caroline flitcroft
 
Posts: 3412
Joined: Sat Nov 25, 2006 7:05 am

Post » Thu Feb 11, 2010 1:34 am

Start a new thread, state your problem, and post your load order. Best guess without that info is that it is load order related.

gothemasticator
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Thu Feb 11, 2010 7:03 am

Start a new thread, state your problem, and post your load order. Best guess without that info is that it is load order related.

gothemasticator



Your wish, my pleasure: http://www.gamesas.com/bgsforums/index.php?showtopic=1057087 ;)

Thanks a lot.
User avatar
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Wed Feb 10, 2010 10:36 pm

I have a question regarding GetFirstRef that I'm having trouble with.

I wrote a script that uses GetFirstRef/GetNextRef to loop through all of the Creates (type 43) in an exterior area. The code works great at identifying the two Brahman that I have in the cell, but when I kill the Brahman, it still comes back identifying them. If I disable them after killing them, FOSE still reports finding the creature (as a reference).

Is there an additional check that I need to do in addition to the reference check for Creatures to determine whether or not they are dead? I should think that GetFirstRef will return 0 or Null when I try to assign it in a cell with only dead NPC's, but I could be mistaken. Below is the code fragment:

		set NPCcount to 0		set rCurrentRef to GetFirstRef 43 0 0; Creatures		Label 100		if rCurrentRef			if rCurrentRef.GetPlayerTeammate == 0				printc "Found NPCs"				set NPCcount to NPCcount + 1				set rCurrentRef to GetNextRef			endif			Goto 100		endif


This code fragment always returns with NPCCount > 0 (even if the creatures in the cell are dead). I tried setting the cell depth to 1 ( GetFirstRef 43 1 0), but this seemed to have no effect.

Thoughts?

Miax
User avatar
Suzy Santana
 
Posts: 3572
Joined: Fri Aug 10, 2007 12:02 am

Post » Thu Feb 11, 2010 11:04 am

I have a question regarding GetFirstRef that I'm having trouble with.

Your best bet is to use the http://cs.elderscrolls.com/constwiki/index.php/GetDead function call (still in GECK as it was in the Construction Set) on each creature reference you find with the GetFirst/NextRef.

Even disabling a creature doesn't stop any scripts for it running, it just stops it rendering and having Havok run on it - but it's still in the cell. Similarly, killing it just sets its state to 'dead', but doesn't actually remove it as a reference.

Good luck :).
User avatar
He got the
 
Posts: 3399
Joined: Sat Nov 17, 2007 12:19 pm

Post » Thu Feb 11, 2010 4:23 am

Your best bet is to use the http://cs.elderscrolls.com/constwiki/index.php/GetDead function call (still in GECK as it was in the Construction Set) on each creature reference you find with the GetFirst/NextRef.

Even disabling a creature doesn't stop any scripts for it running, it just stops it rendering and having Havok run on it - but it's still in the cell. Similarly, killing it just sets its state to 'dead', but doesn't actually remove it as a reference.

Good luck :).


Thanks for the input. :)

I just tried this, and it seems to work to reduce the count of NPC's found in the cell once the brahman are dead, but it's still detecting some Creature somewhere (its not coming up with 0 after I kill the only Brahman in the cell). Its very strange - there are no creatures anywhere in this exterior area except the brahman I placed for this test - yet the function is still finding something.

Does anyone know what the "cell depth" argument's parameters are for GetFirstRef? The documentation is absent on what this parameter really does...

Miax

EDIT: I got it to work, it was my code. I'm still curious as to what the "cell depth" argument means... I presume it's something to do with Exterior cells?
User avatar
Max Van Morrison
 
Posts: 3503
Joined: Sat Jul 07, 2007 4:48 pm

Post » Wed Feb 10, 2010 8:45 pm

Hello. Please excuse the remedial question, but I am having trouble with a backpack module which uses this script, for a dynamic pack weight. I have somehow managed to bork the variables, probably by moving script-weighted ammo in and out of the pack. The script seems to be cross-save, too. May I ask if there is anyway to purge stored variables, to try starting over?

scn JWBackpackScriptRef playref ; player refRef packref ; backpack refRef contref ; backpack container refFloat packWG ; weight of container contentsFloat emptyWG ; weight of backpack itselfFloat packHeavy ; is pack to heavyFloat packSWG ; saved pack weightShort DoOnce ; setup flagShort FirstFind ; first time touched flagShort packState ; backpack access statebegin OnActivateset playref to GetActionRefif (playref != player)returnendifif FirstFindset FirstFind to 0showMessage JWBackpackM1endifif playref.IsSneakingset packState to 1contref.Activate playrefelseif (packHeavy > 1)showMessage JWBackpackM2, packHeavyelseActivate ; pick up backpackendifendifEndBegin MenuModeif packState == 1set packWG to (((packref.GetWeight) - emptyWG) * 2) + playref.getactorvalue InventoryWeightset packState to 2endifEndBegin GameModeif DoOnce == 0set DoOnce to 1set FirstFind to 1set packref to thisset contref to JWBackpackContainerRefcontref.RemoveAllItemsset emptyWG to packref.GetWeightset packWG to emptyWGset packSWG to emptyWGendifif packState == 2set packWG to ((packWG - playref.getactorvalue InventoryWeight) / 2) + emptyWGif (packWG < emptyWG)set packWG to emptyWGendifpackref.SetWeight packWGset packSWG to packWGset packHeavy to (packWG * 2) - 108if playref.HasPerk Strongbackset packHeavy to packHeavy - 100endifset packState to 0endifif GetGameRestarted == 1packref.SetWeight packSWGendifEndBegin OnAdd playrefplayref.EquipItem JWBackpack 0 1EndBegin OnUnequip playrefif (playref.GetItemCount JWBackpack)playref.EquipItem JWBackpack 0 1endifEnd

User avatar
james kite
 
Posts: 3460
Joined: Sun Jul 22, 2007 8:52 am

Post » Wed Feb 10, 2010 10:02 pm

*self-fives and happy dances*

Nevermind. I fumbled my way through to fixing my problem. Somehow packref and emptywg were set to 0000 0000, and 0 respectively. :3
User avatar
Peter lopez
 
Posts: 3383
Joined: Mon Sep 10, 2007 5:55 pm

Post » Thu Feb 11, 2010 9:52 am

I'm still curious as to what the "cell depth" argument means... I presume it's something to do with Exterior cells?

It controls how many exterior cells the code will search, going out prom the initial cell. I'm not sure of the detail, but I assume the workload goes up exponentially for each increase in cell depth - so best to keep it as low as possible.
User avatar
JeSsy ArEllano
 
Posts: 3369
Joined: Fri Oct 20, 2006 10:51 am

Post » Thu Feb 11, 2010 8:46 am

As far as I know, increasing cell depth causes all cells adjacent to those already being checked to be included, which makes this the formula:
cells checked = 2*(cell depth)^2 + 2*cell depth + 1
I'm not sure what effect, if any, it has on checking interior cells.

Cipscis
User avatar
Richus Dude
 
Posts: 3381
Joined: Fri Jun 16, 2006 1:17 am

Post » Wed Feb 10, 2010 8:19 pm

As far as I know, increasing cell depth causes all cells adjacent to those already being checked to be included, which makes this the formula:
cells checked = 2*(cell depth)^2 + 2*cell depth + 1
I'm not sure what effect, if any, it has on checking interior cells.

Cipscis


Interesting... Thanks for the formula!

Right now my script is limited to one cell, and I use multiple copies of the script for each exterior cell that I need to check and put in a "Is. That way I don't stray outside the cell I am intentionally checking which turns out to be what I wanted, as I put in a check to see if the player is InCell (so the script only runs when the player is in the target cell). The script is below, and the overall output of the script is to simple Enable/Disable the linked X Marker (which I use later in my quest-stage script). My hope was that by using a Linked x-marker to indicate that the cell is empty, I could use the same script later on for many cells (interior and exterior). The Xmarker will let act as a master enable and activate parent for actions I need to take later on. The script, thanks to FOSE, works very well:

scn NonFollowerDeadDetectionSCRIPTint StartUpint RunScanint ScanBlockint NPCcountfloat CurrentTimeref NonFriendlyXMarkerref rCurrentRefBegin GameMode; don't run if the xmarker is already disabled. 	set NonFriendlyXMarker to GetLinkedRef	if NonFriendlyXMarker.GetDisabled == 1		Return	endif; don't start working until player enters the cell	if GetInSameCell player		if StartUp == 0			set StartUp to 1			set CurrentTime to 1		endif	endif; Put us into a time loop, work every 3 seconds	if StartUp == 1		if CurrentTime > 0			set CurrentTime to CurrentTime - GetSecondsPassed		elseif RunScan == 0			set CurrentTime to 3			set RunScan to 1		endif	endif; run the cell-scan for non-friendly NPCs. If we find Any non-friendly NPC's, we're done. 	if RunScan == 1		set RunScan to 0		set NPCcount to 0		set rCurrentRef to GetFirstRef 43 0 0; NPCs		Label 100		if rCurrentRef			if rCurrentRef.GetPlayerTeammate == 0				if rCurrentRef.GetDead == 0					if rCurrentRef == player						set rCurrentRef to GetNextRef						Goto 100					else						set NPCcount to NPCcount + 1						Return					endif				endif			else				set rCurrentRef to GetNextRef				Goto 100			endif		endif; If were still in the script at this point, all non-friendly NPCs are dead		if NPCcount == 0			NonFriendlyXMarker.Disable		endif	endifEnd


I'm sure I could be doing this better in some areas, and am always open to feedback and criticism!

Thanks,

Miax
User avatar
stevie critchley
 
Posts: 3404
Joined: Sat Oct 28, 2006 4:36 pm

Post » Wed Feb 10, 2010 11:04 pm

I have a request, re: http://www.gamesas.com/bgsforums/index.php?showtopic=1055023.

Could you add the "con_tm" and "con_tfc" functions to FOSE?

One more request to add to my wish list... "con_tcl"

danke schoen...
User avatar
KRistina Karlsson
 
Posts: 3383
Joined: Tue Jun 20, 2006 9:22 pm

Post » Thu Feb 11, 2010 1:54 am

Odd problem I'm having with v1.2 beta 1: I've no idea why, but recently it began to prevent me from loading anything in the GECK's render window. I tried everything else, then tried minus FOSE and the render window loads fine (either without FOSE or after reverting to FOSE v1.1 beta 9) while after reinstalling 1.2 beta 9 it crashes invariably. It's only the render window that's touchy as I'd been mostly scripting and hadn't had any problems compiling/loading/saving. Anyone else have something like this happen or possibly have a solution? Thanks :)

Ssenkrad: Love the Saruman quote. :biglaugh: *cough*
User avatar
scorpion972
 
Posts: 3515
Joined: Fri Mar 16, 2007 11:20 am

PreviousNext

Return to Fallout 3