Jump to content

Modular mod


anlashok

Recommended Posts

I was wondering about making a mod creation as modular as possible. By modular I mean the user should be able to download a new version of the mod and instantly start using it instead of the old one, without running to any problems. A simple example would be an indoors building with two floors , the second accessible only via an elevator. The modder releases a first version containing only the ground floor, where is some meaningful stuff to do. Soon after the modder releases a new version which contains also the second floor, which is a new cell.

 

What should be paid attention to with this approach? I think that a two-floor example like that would work without problems, because the first floor-cell only sees an update to the elevator button's script or something like that which shouldn't cause any problems. However, what about more complicated updates? For example, if there is a guy in second floor who will occasionally visit the first floor (obviously only after installing the new version)? That's probably ok too, because it doesn't change much in the first floor. Maybe it adds some patrol markers or does something else that's not very significant. But the thing that I think might be problematic is when there is a guy in the first floor who might want to sometimes go to second floor after the update is installed. That requires adding a new AI package or modifying an existing one, and that's what I fear will break things.

 

I hope someone more experienced will tell me what happens. Does the NPC forget all the previous conversations with the player? Does his/her inventory reset? Or maybe something else happens? Thanks in advance.

Link to comment
Share on other sites

yea it should be possible, just have the doors/portals, mask the those of the first mod, by the second.
Link to comment
Share on other sites

such queries are best explored and resolved through experimentation and testing! None can say exactly the specifics of the problems you will encounter until you actually go about deciding exactly what you want.

Creating a second story to an existing cell is fine and should work, just make sure the door leading up to it is either sealed, nonexistant or hidden until its time to actually be able to go up there.

Link to comment
Share on other sites

Thank you for responses. The exploration part is otherwise fine, but because this is more like a meta-feature than a concrete one, whose idea comes from being able to provide content to players faster and make debugging easier (=faster), I think vast experimentation might actually be counter-productive. Of course in the long run it would be helpful, so I'll think about what to do.
Link to comment
Share on other sites

regarding that ai package just use a script in the addon

 

begin gamemode (just an example)
mynpc.addscriptpackage goUpstairsAIpackage
evp
end

 

---------------

 

actually there will never be problems if you have a main mod and an addon, you can basicly change whatever you like without breaking it, it can merely overwrite the old setting but nothing lethal can happen

 

----------------

 

it starts to get hairy tho if you intend to create more than one addon as they would subsequently overwrite each others changes to the main mod

 

for that to properly work you either have to lay out the foundations in the main mod (for example lots of empty levelled lists in merchant containers)

or add each new content item by script

 

-----------------

 

regarding that elevator: set the door to be inaccesible in the main mod and change it to teleport in your addon OR

use a static instead of a door in the main mod and use placeat or moveto script in the addon to place the real door there OR

create the new door and set its enable parent to the original main mod door and activate "be opposite" or somin along those line - then deactivate the main mod door by script OR

just delete the old door and create a new one

 

-------------------

 

as i said thats all no problem as long as the number of possible addons is limited otherwise conflicts will eventually emerge

Link to comment
Share on other sites

Thanks! For some reason I never realized I could add packages to actors via a script. Do you also know if it's possible to set package priority that way? I checked GECK and CS wikis but found no promising-looking functions.

 

Edit:

What would be the best way to run the adding scripts? Add some hidden item to first area which has onLoad block which does stuff? Also, what does 'evp' do?

Link to comment
Share on other sites

adding the script: by trigger

 

a trigger can be a:

-a triggerbox also called cubic activator (that box with a T on the upper left)

-a quest

-any item with a script on it

-another package...

honetsly there are hundreds of possibilities

 

evp:

evaluate script package

same as "resetai" but it only recalculates the packages and the first one in the list whose conditions are met is used

 

resetai and evp should be used under different cicumstances, evp works quite ok with addscriptpackage, resetai works better if you use conditionalized packages

 

-----------------------

 

you cant exactly change the conditions of the packages by script tho and neither the order in which they appear afaik... you can however give the new package, which you add, a condition for example could you add a token item or set a variable somewhere, for this you would need to set upfront thinking "anti" conditions in the main mod packs tho

 

addscriptpackage and removescriptpackage could solve that dilemma for you...

 

-----------------------

 

example:

 

add a cubic activator next to your door, that activator gets a script like that:

 

begin onactivate
johnnyref.removescriptpackage myoldpack
evp
johnnyref.addscriptpackage mynewpack
(maybe) evp
end

 

and youre set

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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