Upcoming Mod Feature (feedback welcome)

Ok so I’m coding in a feature just for modders called ‘Hidden Objects’
basically these are objects that can be active or inactive, and used as preprequisites for other stuff. A good example would be a mod about war. Lets say you have all sorts of events that you want to trigger during war time, ditto dilemmas blah blah, but you only want them if the player has gone to war.

basically you will be able to call a new script called SetHiddenObject(name,1) or SetHiddenObject(name,0) which will set that value to be active (1) or inactive(0).
this will let you set things like a war etc, and then have them as pre-requisites for other stuff.

BUT

The problem is you can’t really ‘create’ these objects at runtime. They have to exist already, but be set inactive.

So I’m adding a new directory to the mods dir that is full of scripts. basically all these scripts get run at the game start. so you can create an inactive war then.

Even as i type this, i think it isn’t flexible enough. But what do you think?

What else would you be able to do in these scripts?

:arrow_right: CreateGrudge might by useful, but I can’t think up an example at the moment…

:arrow_right: It could also be useful to have the scripts use a [prereqs] block so things like that would only effect the mission(s) intended (particularly if CreateGrudge works).

:arrow_right: Maybe these scripts could allow the creation of other hidden variables? By which I mean ones which run from 0 up to 1 as per most other variables in the game rather than simply been a true or false object. I believe you can do this in the simulation.csv file but it might be tidier here where modders don’t have to modify the core files of the user?

It might be the case someone would want a hidden variable to used for complex calculator of a policy cost modifier or as a counter or timer. Maybe a set of dilemmas each which might add to the variable so that if a certain pattern of dilemma selections is made or if certain options group together they can then trigger another special dilemma or event. But I suppose this could be done using CreateGrudge instead and miss-out the “middle man” variable?

I think it would be interesting to add some form of prerequisites to policies.

It would allow modders to create policies which require other policies to be active in order to be implemented, or to create policies which require hidden objects to be active in order to be implemented (like War Tax ,for example,which could be implemented only with the war object active)

Is it possible to code this in the game ?

Cliff,

I can’t see a problem with having this script file thing. If it was something I could create alongside the events, dilemmas etc. I would be creating, I can’t see a problem. Just like creating a CSV/text file for each event, I could create a file for each hidden object I needed in the game. I shouldn’t imagine that there would need to be much in these files beyond a name, and perhaps a default value.

I think that this would be useful for things like the lightbulb dilemma being discussed in another thread - I know that it can be done already, (as probably can the war one is a similar way) but this would probably be a cleaner way of doing it. I think it would add a whole new dimension to the game if there were events and dilemmas dependent on the choices in previous dilemmas. Looking through the current dilemmas in the game, I think that many of them would benefit from having events that occurred as a result of a particular decision. When creating dilemmas I’ve often thought that there could be multiple different outcomes from a particular decision, and that rather than simply immediantely using a CreateGrudge, I would like to “enable” a number of different “outcomes”, which could be done through events. The results of decisions often in real life have long term impacts.

To look at an existing dilemma, picked pretty much at random, take the “Torture Deportation” dilemma. The immediant results are all well and good, but such a decision may well have long term ramifications. For example, if he was deported, a few turns down the line the player may discover that he had indeed been tortured. Alternatively, if allowed to stay, he could commit another crime, or, alternatively, do something really good. That is a far more realistic approach.

I also agree with DreamTwister. I would love to see prerequisites for policies. If the prerequisite ended, the policy would simply be cancelled, with perhaps a message popping up to explain what had happened. However, it would be good if we could have some sort of prerequisite that was not merely boolean for this purpose. For example, you may want a policy to only become available if GDP was about 0.75. Something like GDP>0.75 in the prerequisites field. I would like to see this extended to other elements, such as events and dilemmas. It’s possible to have a go at doing this with influences, but it would be cleaner and easier if you could just do it as a prerequisite.

Prerequisites for policies! Now thats an idea :smiley:. It could add a lot to my inflation mod-which is pretty much complete at the moment (even though there is a lot I want to add to it.)

Also, a very minor feature here, I have been finding that the policies for my war mod do not fit in the policy wedge-is it possible to expand this wedge (Transportation gets few policies too :wink:.

And, thanks for taking modders suggestions in too :slight_smile:.

Hmmm, I think a bit of a rethink is needed by me on this.
How about if the icons shrink as mroe of them are in a particular wedge? would that be ok? or are they too small already?

I think that the icons shrinking is a good idea.

Thats a great idea for smaller mods, but my war mod will have over 10+ policies, although I do not expect the end user to use all those at once, it could be a problem if the user wants to annihilate his foe :slight_smile:.

Edit:

Also, would it be possible to add scrolling bars to manifesto promises and achievements?

This is all getting a bit behind schedule because it’s not proving as easy as it sounds, and I am swamped with other stuff. Possibly making manifesto and achievements scrollable would be quicker and easier.

I’ve done the code for achievements to have scroll buttons and support extra ones, although for now that will mean adding to the existing csv file. I’ll try and get it tested today, with the new policy and situation tweaks, and uploaded. If not, tomorrow :smiley: