Jump to content

what can you do with AT_INTERACTIVE_EXIT?


subtledoctor

Recommended Posts

Can it trigger an INCLUDE command and then run some actions in a .tpa file?

 

Background: this is for multiclass cleric kits. In one of our optional installation methods, you can install a bunch of kits, some of which include multiclass variants that get installed alongside the single-class version. E.g. the Nightrunner of Mask gets installed as both a cleric kit and as a cleric/thief kit.

 

Then you are asked whether to install the sphere system (which adds bunch of stuff to each kit's clab table). And then you are asked whether to run Aquadrizzt's multiclass kit function (which converts multiclass clab tables into .eff files in the trueclass clab table).

 

Thing is, that last part shouldn't be optional. If the player days 'no' then multiclass kits might not get spell access. So how can I have

- several components

- a separate, optional component

- a mandatory component

 

?

Link to comment

So how can I have

- several components

- a separate, optional component

- a mandatory component

 

?

Do those things in a single component. You can ask the same questions in components by taking inputs and acting accordingly ... the ACTION_READLN ... and ... PRINT can do so many things... like say ask:

PRINT @2
PRINT @3
ACTION_READLN function
OUTER_WHILE (!(IS_AN_INT %function%) || (%function% > 3) || (%function% < 1)) BEGIN
  PRINT @2

@2 = ~Which type of function would you like the timer to be for the arcane spells ?

1) Timers are defined by a constants summed with a linear function and an exponential function, both based on the spells own level.

2) Timers are randomized to a set value.~

Link to comment

That would be... way too complex. The structure is:

 

 

A) How would you like to install things?
  1) install everything at once
  2) ask me each part individually
B) Would you like to install cleric kits? (REQUIRE_COMPONENT A2)
  B1) Would you like to install cleric kit alpha? (REQUIRE_COMPONENT B)
  B2) ditto
...
  B15) ditto
C) Would you like to install druid kits? (REQUIRE_COMPONENT A2)
  C1) Would you like to install cleric kit alpha? (REQUIRE_COMPONENT C)
  C2) ditto
...
  C15) ditto
D) Would you like to install ranger kits? (REQUIRE_COMPONENT A2)
  D1) Would you like to install cleric kit alpha? (REQUIRE_COMPONENT D)
  D2) ditto
...
  D15) ditto
E) Would you like to install paladin kits? (REQUIRE_COMPONENT A2)
  E1) Would you like to install cleric kit alpha? (REQUIRE_COMPONENT E)
  E2) ditto
...
  E15) ditto
F) Would you like to install the sphere system? (REQUIRE_COMPONENT A2)
G) Would you like to run the multiclass kit function? (REQUIRE_COMPONENT A2)

 

The optional stuff between component A and component G is about 65 separate components. That's too much.

 

Can I force component G to be installed, while still making it subject to (REQUIRE_COMPONENT A2) ?

Link to comment

From the WeiDU readme (if it is of any help):

AT_EXIT commandToRun [ EXACT ]
Whenever this component attempts to be installed, commandToRun is executed. Variables (e.g., %LANGUAGE%) in the string commandToRun are replaced by their values. Note that the command is executed even if the component does not install correctly, so AT_EXIT should probably be the last command in a component.

If commandToRun consists of a single TP2 filename, WeiDU will enqueue that TP2 file and run it when the current one is done (asking the user all the standard questions about languages and which components to install).

If commandToRun consists of the word VIEW followed by a file, a system-specific viewer will be used to present the file to the user. For example, on Windows systems notepad will be used to view txt files and a web browser will be used to view html files. Note: also NOTEPAD and EXPLORER work like this, but use of those are reserved to differently able modders.

Otherwise, commandToRun is executed by the underlying operating system (and is thus system dependant). If you want to do something that WeiDU doesn’t handle, like extracting WAVs from an MP3, make a batch file and run it from here.

Slashes and backslashes will be converted appropriately for the underlying operating system. If EXACT is specified, / and \ will instead be preserved as they are. The most common usage is:

AT_INTERACTIVE_EXIT ~VIEW mymod\README.txt~

This causes your README file to be displayed using a system appropriate viewer. Here’s a more complicated example that pulls up a language-specific README if one is available:

ACTION_IF FILE_EXISTS ~mymod\README.%LANGUAGE%.txt~ THEN BEGIN

AT_INTERACTIVE_EXIT ~VIEW mymod\README.%LANGUAGE%.txt~

END ELSE BEGIN

AT_INTERACTIVE_EXIT ~VIEW mymod\README.txt~

END

AT_INTERACTIVE_EXIT commandToRun [ EXACT ]
As AT_EXIT, but the command is only executed if the user specifically asked for the component to be installed or upgraded.
Link to comment

You could use the INSTALL_BY_DEFAULT flag for the component, and make sure it also has a prerequisite that at least one of the other components is installed (so it doesn't end up as the only thing installed if they skip everything else).

Link to comment

From the WeiDU readme (if it is of any help):

 

Yeah, but the Weidu readme is vague about what constitutes a "command." On its face I might interpret that to include Weidu actions, but every example - and every mod I could find that uses it - involves exterior commands to run other programs, like Notepad or a web browser. And it's not very clear how to call a .tp2 file. That section could really use some clarifying examples.

 

Mike, thanks. Sounds like INSTALL_BY_DEFAULT would work well - as you say, as long as it defers to REQUIRE_COMPONENT or REQUIRE_PREDICATE MOD_IS_INSTALLED.

Link to comment

... but every example - and every mod I could find that uses it - involves exterior commands to run other programs, like Notepad or a web browser. And it's not very clear how to call a .tp2 file. That section could really use some clarifying examples.

That's probably because it's clearly designed to use for that ... running of other programs.

It's the stop cap before things like HANDLE_AUDIO, README etc were introduced to weidu. The later should tell you how old it is... and how well documented it is, should.. never mind. :p

Link to comment

That's probably because it's seemingly designed to use for that ... running of other programs.

Fixed that for you. If it was "clearly" designed for that, the readme could say something simple like "this is designed for running other programs."

 

Anyway yeah I get that's the common use, that's why I asked "what else can you do with it?"

Link to comment

AT_INTERACTIVE_EXIT

 

As AT_EXIT, but the command is only executed if the user specifically asked for the component

AT_EXIT

 

Whenever this component attempts to be installed, commandToRun is executed

...

If commandToRun consists of a single TP2 filename, WeiDU will enqueue that TP2 file and run it when the current one is done

 

I guess I'm kind of repeating CrevsDaak. To clarify, though, any AT_* command can launch an independent, fully-fledged TP2, which can even be a separate mod.

 

In the specific case of 65 or so components, I would consider looking into reducing that number. From user point of view, I want to install quickly and choose inside the game. Not scout the dozens of mod readmes for what exactly this or that component does.

Link to comment

any AT_* command can launch an independent, fully-fledged TP2, which can even be a separate mod.

Yeah but there's no indication of what the proper phrasing is. A .tp2 file is not a command, it's a filename.

 

Re: component design - the user doesn't have to actually wade through 65 components. If you don't want any new kits, and just want to apply the sphere system to the vanilla kits, you can just press:

[2] install things individually

[N]o don't install new cleric kits

[N]o don't install new druid kits

[N]o don't install new paladin kits

[N]o don't install new ranger kits

[Y]es install the sphere system

 

So, only 6 keystrokes. If someone wants to install new druid kits only, they can delve into the 10-15 kits in that section. They only way you would go through all 65 components is if you want to install everything... and then you could just hit option 1 "install everything" at the beginning and do it in s single keystroke. We're trying to give users maximum flexibility while keeping the installation procedure relatively efficient.

Link to comment

A .tp2 file is not a command, it's a filename.

Yeah, it's a file with commands. Like say:

"make --bif modname_folder", which is actually a single command... one, it's not a series or a plural, but a (single). Which is a possibility and thus could remove the s.

 

Re: component design - the user doesn't have to actually wade through 65 components.

But ... how many yes/no's will the install-person be wading through if he wants to install half of the content... will it be a 2,yes,no,yes,no, yes... or 2, yes, to b1, b3, b5--- b11, c2, c4, c6... something. Or how complicated will a .bat file will look like to install those half.

Also you could allow say install all same class kits (or decide individually those too.. or not, as there's really no point anymore, the player can have 1024 kits at least).

Link to comment

I mean, the alternatives are:

- Make it an all-or-nothing proposition instead of giving players a choice for each kit (but, we already have an option for users who want to treat the mid that way)

- Don't make as many kits (but then, why are we modding in the first place?

 

I could easily make subcomponents for each class, asking if the user wants to 1) install all kits for that class, 2) decide each one-by-one, or 3) skip it and go to the next class. But that would make it worse for a .bat file...

Link to comment

But that would make it worse for a .bat file...

How exactly ?

Cause you can use either of the two provided options in the .bat too.

It can have a text file that just gives the wanted answers, even if there's 1000 of questions, like the L1NPCs NPC installs can have... but usually less is better.

 

Hows that worse, exactly ?

Ouh, and you can actually build the install options so that they install multiple independent components, and not show the components themselves, unless that option is chosen.(and thus the weidu.log shows that you installed each of the kits separately, even if you just answered "Y"/es to an "Install all ?")

Link to comment

Archived

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

×
×
  • Create New...