Jump to content

Passing String Variables into Mod statements?


Recommended Posts

Let's assume one is working on a new mod that reads an INI file.  And lets assume the desired  INI file would have a list of additional  Mods, and the Hexadecimal IDs for the forrm/objects being tested.

 

How can one pass strings into the  IsModLoaded  and  GetFormFromMod commands?

 

The syntax is supposedly :  

return = IsModLoaded filename (string)

and

return = GetFormFromMod filename (stringformID (string)

 

However, it appears only to work if you're passing the actual strings into the commands and not string variables.  

 

As an example, I tried this combination:

    ;; Set string values (from defined string_var values)
    let loadedmodname := sv_construct "LoversProstitute.esp"
    let loadedmodref := sv_construct "001CBF"

	;; Doing a test
    if IsModLoaded loadedmodname
        messageboxex "It Loaded"
    else
        messageboxex "Dammit"
    endif

You would FIGURE that a command that claims to accept string data would accept variables defined for strings, but noooo.... it doesn't look it.

 

Or is there a way?  PREFERABLY WITHOUT USING PLUGGY????

 

For those curious... yep, that's the xLoversProHToken that is used to show what 'stage' a prostitute is in their work.  Part of a fun little mod I'm working on, an LAPF Extended patch  that DOES halt the 'couple embrace' feature, stops certain features with creature sex (a fix), and deals with issues with Hiyoko Shooter (a fix) while... automatically setting the Progression system to 'manual' for yaou, and more.

 

PK Extender was the brain child of Donkey, who is no longer at this forum.  If you are going to do anything, I'd recommend starting over making a mod instead of trying to modify PK Extender.  That is a complicated mod with scripting that no one here understands anymore.  The "cuddle" was kinda the main feature of the mod, so tearing it out is like trying to gut the thing and hope it still breathes.  

Yeah... not so hard  as you;d think with a little study.  Just call me a  quacking rosetta stone.

 

Link to comment

have you tried prefixing the variables with a $ sign? 

 

from the OBSE documentation:

 

Quote

As of OBSE v0017, string variables can be passed to any command expecting a string literal as an argument by prefacing the name of the variable with a dollar sign. This deprecates many of the Set...EX commands. The variable must be local to the calling script and its name must immediately follow the '$' without parentheses.

 

Example:

    string_var msg
    let msg := "Greetings from Stonekeep, " + player.GetName + "!!!"
    MessageBox $msg

 

Akor

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use