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

Post » Fri Feb 18, 2011 7:47 pm

The documentation for http://fose.silverlock.org/fose_command_doc.html#SetIsControl (specifically the parameter information) is incorrect. It should read like this:
SetIsControl Alias: noneParameters:2    scanCode:Integer     isControl:Bool Return Type: BoolOpcode: 0x1462 (5218)Condition Function: NoIntroduced In: 1 Calling Convention: BDescription: Flags a key or mouse button as a control, allowing modders to define custom controls - other scripts can then use IsControl to detect conflicts in which two mods try to use the same key for different actions.

Cipscis
User avatar
Laura Elizabeth
 
Posts: 3454
Joined: Wed Oct 11, 2006 7:34 pm

Post » Sat Feb 19, 2011 12:00 am

The documentation for http://fose.silverlock.org/fose_command_doc.html#SetIsControl (specifically the parameter information) is incorrect. It should read like this [snip]

Ah, that is much better. Those parameters make more sense. I'll try that.

I'm guessing that I'll also need to add code that runs every time a savegame is loaded to tell FOSE that the key is in use? Or, does that info get saved in the save game just like my assigned key does? Is there a good code example to look at?
User avatar
Jennifer May
 
Posts: 3376
Joined: Thu Aug 16, 2007 3:51 pm

Post » Sat Feb 19, 2011 7:42 am

I ran into a potential problem with editing form lists with scripts. I have an application where a shared resource will perform certain actions on any forms added to its formlist by other mods. The problem is that if a mod adds a form to the list, it stays there after the mod is removed. That's not that big of a deal, but it stays there even if the form was something unique to that mod. Attempting to use listgetformindex with the list containing the invalid form, or listgetnthform on the invalid form itself, will crash the script. It would be great if there was a "cleanformlist" command that could go through and strip out the invalid forms.
User avatar
X(S.a.R.a.H)X
 
Posts: 3413
Joined: Tue Feb 20, 2007 2:38 pm

Post » Fri Feb 18, 2011 11:37 pm

I was wondering if nested loops are possible with FOSE. I tried:

scn 1ntfsTestLoopScriptshort doonceBegin GameModeLabel 1if doonce < 200	Label 2	if doonce < 100		set doonce to doonce + 1	goto 2	endifgoto 1endifend


but the game crashes as soon as the script begins. Is there something I am missing?

Edit: After midnight scripting. Nevermind :snoring:
User avatar
Julie Ann
 
Posts: 3383
Joined: Thu Aug 23, 2007 5:17 am

Post » Fri Feb 18, 2011 10:09 pm

I was wondering if nested loops are possible with FOSE. I tried:

Label 1if doonce < 200	Label 2	if doonce < 100		set doonce to doonce + 1	goto 2	endifgoto 1endif


but the game crashes as soon as the script begins. Is there something I am missing?

The inner loop only increments 'doonce' while it is less than 100, once it hits 100 it stops incrementing and the outer loop goes forever.
User avatar
Laura Hicks
 
Posts: 3395
Joined: Wed Jun 06, 2007 9:21 am

Post » Sat Feb 19, 2011 12:41 am

The inner loop only increments 'doonce' while it is less than 100, once it hits 100 it stops incrementing and the outer loop goes forever.


Thnx, that's what the midnight edit was about, I noticed eventually, sorry about the dumb question :banghead:

I am trying to make a "dual ref-walk" script, meaning a script that gets a reference and then does a ref-walk that does stuff for that reference. In the next iteration, getNextRef is used to select the next reference and perform another ref-walk for that reference. Problem is, damn thing keeps crashing. I thought it was the nested loop, but I'm leaning towards the multi-getFirstRef/getNextRef syntax. After cutting down on lines to find the problem, I have the following script:

scn 1ntfsQuestScriptshort depthref actorref actorLoop2 ref appleref pencilBegin GameModeif player.isInInterior == 1	set depth to 0else	set depth to 2endifset actor to appleset actorLoop2 to pencilset actor to (getFirstRef 200 depth 0)set actorLoop2 to (getFirstRef 200 depth 0)	Label 2		if actorLoop2 != 0			set actorLoop2 to pencil		set actorLoop2 to getNextRef				goto 2											endifif actor != 0	set actor to apple				set actor to getNextRefendifEnd


This script crashes on load unless I comment out the
	set actor to apple				set actor to getNextRef


lines. I can't find a logical error in the script, so I am thinking that I may be using getNextRef in a wrong way, or there is a bug. Any ideas?

Btw, same thing happens if I put a counter in the Label 2 loop to ensure it doesn't run forever :banghead:
User avatar
Bigze Stacks
 
Posts: 3309
Joined: Sun May 20, 2007 5:07 pm

Post » Fri Feb 18, 2011 8:16 pm

I am trying to make a "dual ref-walk" script, meaning a script that gets a reference and then does a ref-walk that does stuff for that reference. In the next iteration, getNextRef is used to select the next reference and perform another ref-walk for that reference. Problem is, damn thing keeps crashing. I thought it was the nested loop, but I'm leaning towards the multi-getFirstRef/getNextRef syntax.

You can only have one reference iterator per script at a time. The assumption was that anything iterating over N^2 objects (where N is the number of refs in a scene) would be very slow. This is fixable via some changes on the code side to give each iterator an ID number (similar to the label/goto number) that differentiates between the two iterations.

This plus some other changes are currently in progress locally, I just need to test them and possibly fix up one other thing. I may need to release a Very Probably Broken alpha version and rely on modders for IRL testing due to time constraints.
User avatar
teeny
 
Posts: 3423
Joined: Sun Feb 25, 2007 1:51 am

Post » Fri Feb 18, 2011 11:00 pm

It shouldn't really be slow since I'm ref-walking among the hostile actors around the player in 1 or 2 sec intervals.

I can achieve the same result by adding a script effect to each actor and running the other loop there, so it's no biggie.

Thanks for clearing it up because I was busting my head :D
User avatar
Jonathan Egan
 
Posts: 3432
Joined: Fri Jun 22, 2007 3:27 pm

Post » Fri Feb 18, 2011 9:55 pm

Anyone know what the function opcode for GetNumItems is? I usually develop in FO3Edit and FOMM and keep the scriptfunctions.xml updated with the FOSE commands i use, but i cant find the entries for that one.

Thanks
User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Sat Feb 19, 2011 7:05 am

Anyone know what the function opcode for GetNumItems is? I usually develop in FO3Edit and FOMM and keep the scriptfunctions.xml updated with the FOSE commands i use, but i cant find the entries for that one.

Are you sure it exists? The FOSE docs and my disassembly of the FO3 exectuable don't reveal the presence of a GetNumItems function.
User avatar
Dan Scott
 
Posts: 3373
Joined: Sun Nov 11, 2007 3:45 am

Post » Fri Feb 18, 2011 10:54 pm

Are you sure it exists? The FOSE docs and my disassembly of the FO3 exectuable don't reveal the presence of a GetNumItems function.


It's not documented on the web site, but I pulled a list from a forum post awhile back. I don't have the opcode, though - not sure where to look. Wouldn't it be in the source code for FOSE somewhere?

Here are some not overly great docs for the commands added since the last documentation update (since 1.1)float form.GetCurrentHealth() - returns the health of formvoid SetCurrentHealth(float health, ref form) - sets the health of a formfloat Rand(float min, float max) - returns a random value between min and maxint form.GetNumItems() - returns the number of items in a containerref form.GetInventoryObject(int idx) - returns the type of the specified item in the containerint form.GetRefCount() - returns the number of items in a stackvoid form.SetRefCount(int count) - sets the number of items in a stackfloat Pow(float a, float B) - returns a ^ b (b does not need to be an integer)int form.IsQuestItem(ref obj = NULL) - returns if form (or obj if present) is a quest itemvoid form.SetQuestItem(int arg, ref obj) - sets if form/obj is a quest itemint form.IsOffLimits(ref actor) - returns if the specified door is off-limits to the actor (note: apparently not 100% reliable for the player yet)ref form.GetParentCellOwner() - returns a ref to form's parent cellref form.GetOwner() - returns a ref to form's ownerint form.GetOwningFactionRequiredRank() - returns the rank someone must be of the owning faction to be considered an owner of formint form.GetOwningFactionRequiredRank() - returns the rank someone must be of the owning faction to be considered an owner of form's parent cellref GetCurrentQuest() - returns the current questref GetCurrentObjective() - returns the current objectiveint GetQuestObjectiveCount(ref quest) - returns the number of objectives for the specified questref GetNthQuestObjective(ref quest, int idx) - returns the specified objective of the specified questvoid SetCurrentQuest(ref quest) - sets the player's current questint form.IsPersistent() - returns if form is persistentint form.SetEyes(ref eyes, ref target = NULL) - sets the eyes of form (or target if specified)int form.SetHair(ref hair, ref target = NULL) - sets the hair of form (or target ir specified)int form.SetHairLength(float length, ref target = NULL) - sets the hair length of form (or target if specified)ref form.GetEyes(ref target = NULL) - gets the eyes of form (or target if specified)ref form.GetHair(ref target = NULL) - gets the hair of form (or target if specified)float form.GetHairLength(ref target = NULL) - gets the hair length of form (or target if specified)

User avatar
Ebou Suso
 
Posts: 3604
Joined: Thu May 03, 2007 5:28 am

Post » Sat Feb 19, 2011 4:06 am

I didn't realize the docs were out of date. Looking at the code, I'm going to say it is 0x14c1.

	// v2 - starts at 0x14be	ADD_CMD(GetCurrentHealth);     be	ADD_CMD(SetCurrentHealth);     bf	ADD_CMD(Rand);                 c0	ADD_CMD(GetNumItems);          c1	ADD_CMD(GetInventoryObject);

User avatar
x a million...
 
Posts: 3464
Joined: Tue Jun 13, 2006 2:59 pm

Post » Fri Feb 18, 2011 7:04 pm

I was wondering, is the getFirstRef/getNextRef combo relatively CPU intensive? I noticed weird behaviours when running a multiple ref walks at the same time. When I increased the time interval of my quest script the actors' behavior was better. It has to be pretty high though, so I'm doing optimizations :P
User avatar
Chris Cross Cabaret Man
 
Posts: 3301
Joined: Tue Jun 19, 2007 11:33 pm

Post » Sat Feb 19, 2011 2:33 am

I was wondering, is the getFirstRef/getNextRef combo relatively CPU intensive? I noticed weird behaviours when running a multiple ref walks at the same time. When I increased the time interval of my quest script the actors' behavior was better. It has to be pretty high though, so I'm doing optimizations :P

GetFirst/NextRef are not expensive by themselves, but since whatever you are doing scales linearly with the number of references in the scene (which can be a very large number), the sum can get expensive.
User avatar
matt white
 
Posts: 3444
Joined: Fri Jul 27, 2007 2:43 pm

Post » Fri Feb 18, 2011 10:56 pm

I was wondering, is the getFirstRef/getNextRef combo relatively CPU intensive? I noticed weird behaviours when running a multiple ref walks at the same time. When I increased the time interval of my quest script the actors' behavior was better. It has to be pretty high though, so I'm doing optimizations :P



GetFirst/NextRef are not expensive by themselves, but since whatever you are doing scales linearly with the number of references in the scene (which can be a very large number), the sum can get expensive.


The difference seem to be more of a local vs zone wide need if your only catching refs near the player its faster to pop an explosion then it is to GetFirst/Next over and entire cell running multiple GetDistance, GetLOS or GetDetected Player checks which are some of the worst functions performance wise that you could try to shoehorn into a single game frame at that point the Empty Explosion is several times faster and causes zero FPS loss because it can be processed over multiple game frames so the process overhead is leveraged.

For me the Limit to what I was willing to run with GetFirst/Next was pretty much to look for ANYTHING but actors due to the fact that I run MMM and SSP-CC for my creature needs and with those two I end up with anywhere from 30-60+ actors in range of the GetFirst/Next and trying to process that many actors was costing me 5-10 FPS every time that function was looped (which resulted in visible FPS loss) -> where as an Explosion costed me zero FPS to do the exact same thing within its Range, and the Only difference between the two scripts was a GetDistance Check added to GetFirst/Next script as the Explosion did not require it.

So if you looking for anything that is not going to equate to running multiple Get's on 30+ references then GetFirst/Next is probably the easiest way to go other wise I would advise against it.
User avatar
HARDHEAD
 
Posts: 3499
Joined: Sun Aug 19, 2007 5:49 am

Post » Fri Feb 18, 2011 10:16 pm

Thnx a lot, I'm trying your advice and I'll keep you posted on how it goes :)
User avatar
He got the
 
Posts: 3399
Joined: Sat Nov 17, 2007 12:19 pm

Post » Sat Feb 19, 2011 6:18 am

I didn't realize the docs were out of date. Looking at the code, I'm going to say it is 0x14c1.

	// v2 - starts at 0x14be	ADD_CMD(GetCurrentHealth);     be	ADD_CMD(SetCurrentHealth);     bf	ADD_CMD(Rand);                 c0	ADD_CMD(GetNumItems);          c1	ADD_CMD(GetInventoryObject);



Thanks!
User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Post » Sat Feb 19, 2011 3:45 am

Is there really no better way to identify which item is under the cursor than that of http://www.fallout3nexus.com/downloads/file.php?id=9930 , which uses the width of the filename of the item's icon to identify what sort of ammo it is?

Also, why is there no GetUIString to go with the other three functions?
User avatar
Michelle Chau
 
Posts: 3308
Joined: Sat Aug 26, 2006 4:24 am

Post » Fri Feb 18, 2011 8:21 pm

I have a script that uses GetRepairList, and it will cause a CTD if the repair list of the item is set to 'None' in the Geck.
I get the same CTD if I type GetRepairList Item at the console
Can anyone confirm this - is this a known issue?
User avatar
Ana
 
Posts: 3445
Joined: Sat Jul 01, 2006 4:29 am

Post » Fri Feb 18, 2011 10:10 pm

Is there really no better way to identify which item is under the cursor than that of http://www.fallout3nexus.com/downloads/file.php?id=9930 , which uses the width of the filename of the item's icon to identify what sort of ammo it is?

Finding a way to associate the current active tile with its item would be the proper way, but right now that isn't possible.

Also, why is there no GetUIString to go with the other three functions?

Because FOSE doesn't support string variables and other additional types.

I have a script that uses GetRepairList, and it will cause a CTD if the repair list of the item is set to 'None' in the Geck.
Can anyone confirm this - is this a known issue?

Fixed.
User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm

Post » Fri Feb 18, 2011 10:15 pm

Hello, I just have a few questions about current or upcoming functions pertaining to an item customization mod I'm working on. I did most of the scripting for Weapon Mod Kits and am now working on a mod that can change any items stats using TempCloneForm and the SetWeaponXXX functions.

1. Is a persistant CloneForm planned for the next release? Right now I am using invisible inventory objects to manage TempCloneForms but it makes the scripting for non-player items incredibly complex and has some load issues (see 3).

2. Will all the GetWeaponXXX and GetArmorXXX functions have SetXXX functions? Right now there are several key values, such as firing rate and armor rating, that I can get but not set.

3. Can GetGameRestarted be modified to detect exiting to the Main Menu and loading again? Right now I do all my TempCloning on GameRestart which works fine for the first load and all in-game loads but when the player exits to the Main Menu the cloned forms get flushed but GameRestarted doesn't detect the new load so the items are never initialized. If that can't be done then is there a way to manually flush the cloned forms on GameLoaded so that I can initialize on load without getting duplicate items.

I know New Vegas is only a few days away but I think FO3 will retain a large following and if you could find a way to get the first 2 items working it would make item customization a hell of a lot easier for everyone.

Thanks,
Chris
User avatar
[Bounty][Ben]
 
Posts: 3352
Joined: Mon Jul 30, 2007 2:11 pm

Post » Sat Feb 19, 2011 10:40 am

1. Probably not. The functionality we were leveraging in Oblivion no longer exists in Fallout, so we would need to write our own serialization code. It's possible, but I would not expect it at any point soon.
2. Should be possible.
3. Sure.

Note that I don't know when I will have time to get to any of this; right now work is still taking up all of my free time, and it'll only get worse as the year goes on. The highest priority on the list right now is to get NVSE working once it's unlocked on Steam, priorities past that point (other than just putting a beta release together) will be determined later.
User avatar
Ashley Campos
 
Posts: 3415
Joined: Fri Sep 22, 2006 9:03 pm

Post » Sat Feb 19, 2011 7:50 am


RickerHK, on 10 September 2010 - 04:25 PM, said:
I have a script that uses GetRepairList, and it will cause a CTD if the repair list of the item is set to 'None' in the Geck.
Can anyone confirm this - is this a known issue?

Fixed.


Sorry I missed your reply on this. I did not find the updated file from http://fose.silverlock.org/. Thinking you may have replaced the fose_v1_2_beta2.7z file, I redownloaded it and reinstalled. The problem persists.
User avatar
tegan fiamengo
 
Posts: 3455
Joined: Mon Jan 29, 2007 9:53 am

Post » Sat Feb 19, 2011 3:47 am

"Fixed" generally means it was a known issue that has been caught and fixed for the next release.
User avatar
An Lor
 
Posts: 3439
Joined: Sun Feb 18, 2007 8:46 pm

Post » Sat Feb 19, 2011 4:16 am

Hey there, just wanted to ask if there were any plans for functions that evaluate ingestibles? GetNthMagicEffect and IsAddictive or something like that.

That would be really great.
User avatar
Saul C
 
Posts: 3405
Joined: Wed Oct 17, 2007 12:41 pm

Previous

Return to Fallout 3