Jump to content

Calling a SWF function from Papyrus


Lywin

Recommended Posts

So I need to make the Arrow Info above the stamina bar appear. located the correct function in hudmenu.gfx by converting it to a swf.

 

The function is ShowArrowCount(aCount, abHide, aArrows) and assuming from the code it is a int, boolean, string.

 

I tried to figure out how to use the SKSE UI script and the invoke functions, but I don't know how to pass my variables into the function call.

The following code is what I tried to do to set the parameters.

 

UI.SetInt   ("HUD Menu", "_root.HUDMovieBaseInstance.ShowArrowCount.aCount", ArrowCount.GetValueInt())
UI.SetBool  ("HUD Menu", "_root.HUDMovieBaseInstance.ShowArrowCount.abHide", false)
UI.SetString("HUD Menu", "_root.HUDMovieBaseInstance.ShowArrowCount.aArrows", _projectiles[final].GetName())
Invoke("HUD Menu", "_root.HUDMovieBaseInstance.ShowArrowCount")

 

If anyone knows how to call the functions properly I would sure appreciate the help.

Thanks

 

Edit:

Should also mention the Invoke call works, but Arrow Information is "undefined (false)" instead of the name of the arrows and quantity

Edited by Lywin
Link to comment
Share on other sites

My hunch would be aArrows is an Int (or FormID?), not a String. GetName is exclusively a SKSE thing - and anyhow, how would a string work for other languages / localization?

 

What happens if you experiment with SetInt on that param to, say, 0, or 1, or 14?

Link to comment
Share on other sites

function ShowArrowCount(aCount, abHide, aArrows) { 
    var _local2 = 15;
    if (abHide) { 
        if (ArrowInfoInstance._currentframe > _local2) { 
            ArrowInfoInstance.gotoandstop(_local2);
        }
        ArrowInfoInstance.PlayReverse();
    } else { 
        ArrowInfoInstance.PlayForward(ArrowInfoInstance._currentframe);
        ArrowInfoInstance.ArrowCountInstance.ArrowNumInstance.SetText(((aArrows + " (") + aCount.tostring()) + ")");
    }
}

 

This is the code for the function inside of hudmenu.gfx

I'm in school for computer science and I program all the time but I have no idea how to compile for a swf flash file.

 

I was thinking of adding another function though similar to this one, that accepted a string array.

The count of arrows gets converted to a string anyway, and you could read the bool from a string easy and then aArrows is a string anyway I believe.

 

I tried calling the InvokeInt and InvokeString with just the one parameter and whatever is passed in gets output as aCount so i got "undefined (15)" and "undefined (Daedric Arrow)"

so I believe that creating my own function in the swf and recompiling the hudmenu would be the only way to access it, unless SKSE gets updated to allow multiparam of varying types.

Link to comment
Share on other sites

  • 1 month later...

aArrows is a number:

	function ShowArrowCount(aCount: Number, abHide: Boolean, aArrows: Number): Void
	{
		var HideFrame: Number = 15;
		if (abHide) 
		{
			if (this.ArrowInfoInstance._currentframe > HideFrme) 
			{
				this.ArrowInfoInstance.gotoAndStop(HideFrame);
			}
			this.ArrowInfoInstance.PlayReverse();
			return;
		}
		this.ArrowInfoInstance.PlayForward(this.ArrowInfoInstance._currentframe);
		this.ArrowInfoInstance.ArrowCountInstance.ArrowNumInstance.SetText(aArrows + " (" + aCount.toString() + ")");
	}

You can find the source ActionScript here.

Edited by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...