[Mod] "Simoom's Lantern" - Ultimate Cheat Menu

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
Nikola515
Posts: 3190
Joined: Fri, 4. May 12, 07:40
x4

Post by Nikola515 » Fri, 22. Apr 16, 05:29

Any chance of adding NPC stations on map? This would be nice for rebuilding uneverse (like empty sectors). Also it would be useful if we could add NPC'S shipyards to create sinks for economy (something this game needs). Also it would be useful for testing game as well ;)
It's not world hunger because we can't feed poor,it's because there will never be enough to feed the rich .....

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Sat, 23. Apr 16, 00:04

Sorry for the lack of updates folks. This mod is experiencing a bit of a "feature creep" as I discover several more things I want to add to it... :D The next update will have a lot of new stuffs! (I didn't want to post an update until I have thoroughly tested all the new features).
Nikola515 wrote:Any chance of adding NPC stations on map? This would be nice for rebuilding uneverse (like empty sectors). Also it would be useful if we could add NPC'S shipyards to create sinks for economy (something this game needs). Also it would be useful for testing game as well ;)
That is very easily done. All you have to do is turn over one of your stations to an NPC faction via the "Change Faction" menu.

Don't do it using the currently-posted version for doing that, though. In the next update I am including a routine for properly turning over player property to an NPC faction (removes all actors' money accounts if the script detects the player as the original owner of the property - NPC faction actors simply use faction accounts).

Stay tuned. :)

User avatar
Nikola515
Posts: 3190
Joined: Fri, 4. May 12, 07:40
x4

Post by Nikola515 » Sat, 23. Apr 16, 01:51

Nice :) Will shipyards be operational too ? Im using player shipyards mod....
It's not world hunger because we can't feed poor,it's because there will never be enough to feed the rich .....

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Sat, 23. Apr 16, 21:16

In general I am hoping not to modify any in-game assets (to keep my mod save game safe). I think Player Shipyards has some custom assets built in... but if it's possible to do it using vanilla assets, i'll be happy to incorporate it.

Will look into it. :)

hisazul
Posts: 1211
Joined: Sat, 15. Oct 11, 04:12
xr

Post by hisazul » Sat, 23. Apr 16, 21:46

Depends on how that shipyard mod works and how shipyards are added. If existing CV's were modified.... then you'd be fine, probably... if they added their own... no. This doesn't generate menus based on assets so any non default things have to be added ontop... or at least that's what it looked to me when I last looked at files. Plus if you ever wanted to transfer shipyards to npcs... they wouldn't build capital ships on their own, that has to be attached separatly. Hell even plot shipyard doesn't... small ships would be the only thing that would consume resources since they are built like wares by the cradle module(if I remember right) no idea if ai would take those built small ships anywhere or if that also requires additional jobs assigned to whoever.
“Logic will get you from A to B. Imagination will take you everywhere.” - Albert Einstein

User avatar
Nikola515
Posts: 3190
Joined: Fri, 4. May 12, 07:40
x4

Post by Nikola515 » Sat, 23. Apr 16, 23:03

I was hoping to create extra sink by shipyards for economy. This way i could go extreme on empire building (something that i can't do in vanila) :(
It's not world hunger because we can't feed poor,it's because there will never be enough to feed the rich .....

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Sun, 24. Apr 16, 00:15

hisazul wrote:Depends on how that shipyard mod works and how shipyards are added. If existing CV's were modified.... then you'd be fine, probably... if they added their own... no. This doesn't generate menus based on assets so any non default things have to be added ontop... or at least that's what it looked to me when I last looked at files. Plus if you ever wanted to transfer shipyards to npcs... they wouldn't build capital ships on their own, that has to be attached separatly. Hell even plot shipyard doesn't... small ships would be the only thing that would consume resources since they are built like wares by the cradle module(if I remember right) no idea if ai would take those built small ships anywhere or if that also requires additional jobs assigned to whoever.
The other CHEAT MENU mod incorporated both the Player Shipyards mod as well as a bunch of CV modifications (allowing for construction of modified unique/landmark stations as well as Teladi stations, etc.).

This I am avoiding with my mod, since like I said I am keeping all game assets vanilla (except in some rare cases, and ONLY when such modification won't have an impact on the game if the mod were uninstalled. The only example in my mod right now is I increased the Skunk's missile capacity to 5000).

That said, it would still be possible to create player shipyards through my mod, though it won't be constructed through the CVs (since that would require modification to the CV's). I can simply add the options into the menus to spawn such stations directly.

The main challenge is generating player-owned ship traders who will allow you to construct ships - this is where I think the Player Shipyard mod added some modified assets (modify ship trader behavior for when it is working on a player-owned shipyard, since these dialogue trees don't exist in vanilla).
Nikola515 wrote:I was hoping to create extra sink by shipyards for economy. This way i could go extreme on empire building (something that i can't do in vanila) :(
All shipyards (small and large) constantly build small and medium ships; they are treated as production wares, and are produced on a cycle just like all other factories.

L/XL ships are a bit trickier. Last time I checked in my save game, I noticed that Managers of NPC shipyards (excluding the DeVries shipyard built post-campaign) have a blackboard entry $BuildShips. I think this is what signals these shipyards to construct large ships periodically.

I could look into this. Once I figure it out, it should be possible to script it so that any shipyard created through my mod will either:
1) Have a manager that builds larger ships by default, or..
2) Add a blackboard entry to the manager to build large ships if the station's turned over to a NPC faction.

Also need to make sure that all L/XL ships built by these shipyards are issued a "move.die" command after construction is complete (they will fly somewhere out of sight and self-destruct). This may be built into the $BuildShips routine already, but I warrants further investigation.

(Sorry if I seem to be moving along slowly on this mod, have a lot on my plate right now and still figuring things out as I go :) )

User avatar
Nikola515
Posts: 3190
Joined: Fri, 4. May 12, 07:40
x4

Post by Nikola515 » Sun, 24. Apr 16, 18:00

It would be awesome if you manage to get it working ;) Im just happy that someone is attempting to do something like this. Take your time ;)
It's not world hunger because we can't feed poor,it's because there will never be enough to feed the rich .....

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Tue, 26. Apr 16, 18:15

MAJOR UPDATE 4/26/16:
  • [New feature] "Build Stations": Build any station of your choice! If a station is in the game, it is selectable! Construction routine is fully custom-made, and emulates normal CV construction as closely as possible (see OP for details).
  • [New feature] "Safe Word": Makes the player's current target immune to damage. Toggleable.
  • [New feature] "Self-Destruct": Instantly destroys the player's current target. Works on both stations and ships (using different routines). Destroyed stations will remain in a wrecked state (may implement a feature to restore them to working state at a later date. Be careful about using this for now!)
  • [New feature] "Change Faction": Changes the owner faction of the player's current target. Works on both stations and ships.
  • [New feature] "Claim Target": Transfers ownership of the player's current target to them.
  • [New feature] "Upgrade Crew": Upgrades the crew of the player's current target to all 5-stars. Works on both stations and ships.
  • [New feature] "Summon Construction Vessel": Creates a construction vessel (model and number of your choice), fully-loaded with construction wares. All models are available, including the unique plot construction vessel.
  • [New feature] "Restock Construction Vessel": Fully restocks the selected construction vessel with wares. Option to use your current target or choose one from property list (the current target option works on NPC construction vessels!).
  • [New feature] "Undock Construction Vessel": Detaches a construction vessel from its parent station. Option to use your current target or choose one from the property list.
  • [New feature] "Remove Station Wreck": Removes the targeted station wreckage (if it is not part of the galaxy init).
  • [Improvement] "Summon Faction Patrol" : Script completely re-written to utilize convparam. Script length reduced from ~1300 lines down to ~300 lines.
  • [Improvement] "Summon Personnel": Script completely re-written to utilize convparam. Script length reduced from ~700 lines to ~100 lines.
  • [Improvement] Mod menu tree restructured to accommodate the abundance of new features. Also merged some section handlers together to reduce the number of cues.
  • [Improvement] Tons of minor bug fixes, new safety checks, and event monitor feedback improvement.
P.S. - OP completely reworked. Artwork used in banner was done by my wife, in case anyone was curious.
Last edited by Simoom on Fri, 6. May 16, 17:39, edited 4 times in total.

hisazul
Posts: 1211
Joined: Sat, 15. Oct 11, 04:12
xr

Post by hisazul » Tue, 26. Apr 16, 19:00

Damnit and I just started a NWN2 run.... Argh...

Btw nice touch with the descriptions :P Now that I'm playing NWN2 that picture just reminds me of Rakshasa. Oddly fitting too... go figure.
“Logic will get you from A to B. Imagination will take you everywhere.” - Albert Einstein

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Wed, 27. Apr 16, 20:22

Update 4/27/16:
  • [New feature] "Remove Plutarch Overwatch": Removes the wreckage of the Plutarch Overwatch leftover from the campaign. Specifically targets the one in Twilight Sentinel and checks its faction status (ownerless) before removal. If you build your own Plutarch Overwatch stations using this mod, they will be safe from this script.
  • [Bug fix]Build Stations now correctly detects occupied build locations.
  • [Bug fix] Destroy Target now properly disconnects a construction vessel if used on a station with an attached CV.
  • [Removed Feature] "Remove Station Wreck": Removed for now due to targeting issue. Set player stations to despawn by default instead (when self-destructed).
Last edited by Simoom on Fri, 6. May 16, 17:40, edited 1 time in total.

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Thu, 28. Apr 16, 11:18

(merged with another changelog)
Last edited by Simoom on Thu, 28. Apr 16, 14:44, edited 1 time in total.

User avatar
mr.WHO
Posts: 8638
Joined: Thu, 12. Oct 06, 17:19
x4

Post by mr.WHO » Thu, 28. Apr 16, 11:55

I have one request for this script.

During my gameplay with plot some of DV constrcution ships got destroyed before they initiated the construction of stations (I only have two station build, one in Forty-Two and second in Vapour Stream).

If this map is correct (NPC build locations) correct there should be a few more station constructed in a few more zones:

http://roguey.co.uk/xrebirth/universe/c ... /zone-106/

- Extinct Torch
- Fiendish Moloch
- Torrid Veil
- Radiation Belt
- Scorched Aura

Is it possible to have a script that check if the stations are constructed and if not spawn the construction ship that will build the station again?

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Thu, 28. Apr 16, 12:37

mr.WHO wrote:I have one request for this script.

During my gameplay with plot some of DV constrcution ships got destroyed before they initiated the construction of stations (I only have two station build, one in Forty-Two and second in Vapour Stream).

If this map is correct (NPC build locations) correct there should be a few more station constructed in a few more zones:

http://roguey.co.uk/xrebirth/universe/c ... /zone-106/

- Extinct Torch
- Fiendish Moloch
- Torrid Veil
- Radiation Belt
- Scorched Aura

Is it possible to have a script that check if the stations are constructed and if not spawn the construction ship that will build the station again?
Hmm, if I remember correctly, those NPC construction vessels are actually set to indestructable as of 4.0 (I remember looking at them in the save game files and they have a "min_hull" value set), so you either haven't reached a point in the campaign yet where they spawn/started construction, or you are on an old save game file.

In any case, if you are specifically looking to have those NPC stations built, and you are very sure that your NPC CV's have been destroyed, it's actually much easier to just generate a new station and hand over the ownership to RoC/HoA.

I can write a code to spawn all the stations that are supposed to be built post-plot at their respective NPC build locations; it won't even be that difficult to do (copy and paste my current station-building codes and change the build location search logic to find NPC build locations instead), but that's only assuming people will find this useful. Like I said in 4.0 the NPC CV's are supposed to be indestructable; the only issue I've had with them is that they will only finish about 2 stages of the construction, then stop (which can be resolved by using this mod to turn the CV's over to you, assign a new architect to the CV's, and finish the NPC stations manually).

The reason I am leaning against writing a code that generates those post-plot NPC stations is that there's a very high chance for things to go wrong (due to user error) - for example people mistakingly thinking their post-plot CV's have been destroyed when they actually haven't spawned yet, or just haven't started building yet. If I spawned those stations, then the "real" NPC CV's arrive... could be a bit of a problem. I mean at that point if you find stuck NPC CV's who doesn't know what to do, you can commandeer them with this mod, but since they are running on commands issued by a plot-related cue, it may potentially break something.
Last edited by Simoom on Thu, 28. Apr 16, 15:31, edited 1 time in total.

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Thu, 28. Apr 16, 14:44

Update 4/28/16:
  • [New feature] "Trade Offer Updates": Subscribes to trade offer updates on the targeted station (in effect, placing a "trade agent" on the station, though no NPC is actually involved).
  • [Improvement] "Claim Target" now contextually generate crew if the targeted ship has no crew on board. S/M ships get a pilot, and capital ships get a full set of crew (safety routine in place to destroy any old crew, since the detection trigger is the lack of a Captain).
  • [Improvement] All features under "Target Manipulation" now have further-improved targeting behavior. Not only will it properly lock onto the parent of a targeted element, it will now properly lock onto the parent of the parent of a targeted element. This mainly affects targeting of stations, which are sub-divided into modules (before this patch, you had to target a station module to perform any action on the station. Now you can target the surface element of a module, such as a dock location or a turret, and the whole station will be locked onto), but some ships with sub-modules also benefit (e.g. Arawn).
  • [Bug fix] "Undock Construction Vessel": Removed the Architect dialogue tree reset codes because it leads to some weirdness. Currently investigating the cause. Until a proper fix is implemented, for the time being simply assign a new Architect to a detached CV (you can even assign the old one back once it comes on board the Skunk).
Last edited by Simoom on Fri, 6. May 16, 17:40, edited 1 time in total.

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Fri, 29. Apr 16, 15:01

Update 4/29/16:
  • [Improvement] "Summon Stations":
    • Major update to station-spawning routine! The script now spawns a construction vessel first, and jumps it to the proper position just outside of the boundingbox. This CV immediately attaches itself to the build location, thus preventing any further instances of the script from choosing that build location again (which used to happen if the obstruction checks takes too long and the player chose to spawn another station before the obstruction check is finished).
    • Weapon platforms are now deployable! I coded a completely different spawning routine for them. Instead of using a build location (which doesn't make sense for them), they will be created at the exact location of the Skunk. A boundingbox will be created and you will be prompted to leave the area. Once obstruction check is complete, the station is then created. This allows you to precisely place weapon platforms in a zone you wish to defend!
    • Several decorative stations have been switched to use the weapon platform's spawning routine (HoL highway stations, Canteran/Reiver habitations, Teladi pirate dens, etc.) since they are fairly small stations that don't produce anything, so it doesn't make sense for them to occupy a build location and have an attached CV.
    • The massively-powerful Plutarch Overwatch station now uses the weapon platform spawning routine as well! You can deploy them anywhere you want!
  • [Improvement] Enhanced the custom ship jump-in effects for "Summon Auxiliary Fleet", "Summon Law Enforcement", and "Summon Existing Asset".
  • [Improvement] "Safe Word": This function now fully repairs all surface elements of a station or capital ship.
Coming Soon:
  • Canteran Plot Stations: Spawns any missing Canteran stations that were supposed to be built post-plot (if the CV's in your save game were destroyed somehow).
  • Safe Word: Looking into making it replenish ammo and combat drones on command issue. The goal is to make this feature both an invulnerability toggle and a combat restock/repair.
Any other features requests or suggestions, feel free to say! :)
Last edited by Simoom on Fri, 6. May 16, 17:40, edited 1 time in total.

User avatar
Nikola515
Posts: 3190
Joined: Fri, 4. May 12, 07:40
x4

Post by Nikola515 » Sat, 30. Apr 16, 07:07

I just attempted installing this and it didn't work :( I also got sidebar extension on steam workshop as well. Should md and assets folder be in main XR folder on steam apps ? Sorry im new with manual installing (I did it for X3 but it was long time ago) :oops:

Edit: It looks like got it ( I placed all files in toolbar ext.) :D Anyway there is small problem that I noticed when summoning stations and turning them to NPC. It seems all missions like transfer money or get architect stay in players missions. Is there way to get rid of them or abort them ? They are not problem now but they will pile up in future. This is one of best mods I used so fat and it is quite fun. It seems more like XR creative universe that cheat ;) Anyway I hope you get shipyards working for NPC to create extra sink....
It's not world hunger because we can't feed poor,it's because there will never be enough to feed the rich .....

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Sat, 30. Apr 16, 16:18

Hey there Nikola515:

For manual installation of mods, simply place the entire mod folder in C:\Program Files (x86)\Steam\steamapps\common\X Rebirth\extensions\

Since I know what you are hoping to use the mod for (spawning some stations and turning them over to the NPCs), please note the following issues in the version you downloaded:
  1. Stations you create, then turned over to NPC factions, do not properly switch to NPC-specific manager scripts (station manager routine for player and NPC stations are a bit different, and so they run on separate AI scripts).
    This issue has already been addressed in my new build, which will be posted later today.
  2. Shipyards you create do not spawn ship dealers, so you won't be able to build ships with them. Turning them over to NPC factions does not remedy the lack of ship dealers or the manager not building L/XL ships periodically (as he would on a normal NPC shipyard).
    Both of these issues have been addressed in my new build, which will be posted later today.
  3. Stations you create will generate Upkeep missions, even though many of such missions don't make sense (such as prompting you to add drones to Weapon Platforms). This is unfortunately an issue with Egosoft's Upkeep mission generation system, which produces a standard set of upkeep missions when it detects player ownership of any object in the class "station". Egosoft's routine currently does not offer detailed analysis of station properties, such as if it can have drones, or need trade ships (using production or storage capabilities as an indicator). This is unfortunately something I can only address through patching Egosoft's Upkeep mission scripts, and it's somewhat lower on the priority list, so the fix will likely have to wait a little while. For now, you can:
    • Ignore the missions until a fix is available.
    • Turn station ownership back to you and complete those upkeep missions, then turn station ownership back to NPC (if the upkeep mission involves assigning a trade ship, you can spawn one and assign it to the station, then hand over both the station and the trade ship to NPC).
    • Or lastly, you could turn station ownership back to you (IMPORTANT!), then destroy those stations. It's important you turn station ownership back to you before destroying them, because my scripts is set to completely despawn a player-owned station, if self-destructed (otherwise, you will get a station wreck which you can't target).
    Issue will be addressed at a later time.
The next update to this mod will be a major one, and will include the following:
  • New feature "Canteran Plot Stations": Detects if your save game is missing any NPC stations that were supposed to be built in DeVries as a part of the plot (for people on older saves whose DV builder ships got destroyed).
    • Only spawns the missing stations, and will spawn the stations in a fully-built state.
    • Runs proper manager script on the shipyard so it will actually build L/XL ships.
    • Feature will work on non-campaign save games. So if you have a Free Play save, and want the Canteran plot stations to help with DV economy, you can use this to spawn them.
    • Includes integrated fix for the shipyard manager script issue if you are on a campaign save, and the shipyard isn't building ships (Egosoft's fault; I checked the station-building segments in the plot mission files, and it looks like the CV's were instructed to only build the first two sequences of the station. This means the shipyard won't get any L/XL cradles. Unfortunately once the CV's done with building those first two parts of the station, it signals for "init station", which triggers a script in InitUniverse.xml that's responsible for generating station NPC's, adding default wares and ammo, etc. - unfortunately this same script also determines what type of script the station manager should run, and for shipyards it looks for $station.canbuildships (capital shipyard) and $station.canproduceships (small shipyard), then runs "trade.shipyard" or "trade.shipyard.small" on the manager respectively. And since the unfinished DV shipyard has no L/XL cradle... it fails the capital shipyard detection, and the manager doesn't get assigned the correct script (which is why even if you somehow manage to complete the construction of that shipyard, it still doesn't build ships regularly like other NPC shipyards).
  • Massively-improved "Change Faction" codes for handling turning player properties over to NPC factions. The script will do contextually:
    • Assign police units, if station is capable of launching drones.
    • If station is a shipyard, order station manager to run the NPC shipyard script (and if it's a capital shipyard, periodically build L/XL ships). Also turn over ownership of any ship dealers on the station.
    • If station is a warehouse-type (HoL Warehouse, Escape Velocity, Plutarch Exchange, or Terracorp HQ), order station manager to run NPC trade station script.
    • Order station manager to run standard NPC station script otherwise (instead of the player station script).
  • Massively-improved "Summon Stations" codes to generate Ship Dealers on shipyards you build. Also contextually generate station ammo on station spawn.
  • Improved "Auxiliary Fleet" and "Law Enforcement" codes to contextually generate ship ammo.
  • Improved "Safe Word" script to contextually restock ship and station ammo as well as replenish combat drones.

User avatar
Nikola515
Posts: 3190
Joined: Fri, 4. May 12, 07:40
x4

Post by Nikola515 » Sat, 30. Apr 16, 17:50

Thanks for info.... This is going to make XR much more enjoyable ;)

Edit: Sorry i have one more question for you. I noticed that DV shipyard have slow product quota (one L or XL ship per 2h) and other races are much faster. Is this baced on shipyard or race? For example if i give Albion Shipyard to RoC will production be slow like DV RoC shipyard ?
It's not world hunger because we can't feed poor,it's because there will never be enough to feed the rich .....

User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom » Sun, 1. May 16, 01:46

Nikola515 wrote:Thanks for info.... This is going to make XR much more enjoyable ;)

Edit: Sorry i have one more question for you. I noticed that DV shipyard have slow product quota (one L or XL ship per 2h) and other races are much faster. Is this baced on shipyard or race? For example if i give Albion Shipyard to RoC will production be slow like DV RoC shipyard ?
Hmm, according to what I am reading in trade.shipyard.xml, the delay is location-based:

Code: Select all

              <!-- ship building delay is cluster dependent for now -->
              <do_if value="this.station.cluster.macro.ismacro.cluster_b_macro">
                <set_value name="this.$stop_trading" min="25min" max="35min" operation="add" />
              </do_if>
              <do_elseif value="this.station.cluster.macro.ismacro.cluster_d_macro">
                <set_value name="this.$stop_trading" min="170min" max="190min" operation="add" />
              </do_elseif>
              <do_else>
                <set_value name="this.$stop_trading" min="10min" max="20min" operation="add" />
              </do_else>
"cluster_b_macro" is Albion, and "cluster_d_macro" is DeVries. So the delay between ship betwens in Albion is 25 to 35 minutes, while for DeVries it's 170 to 190 minutes (everywhere else it's 10 to 20 minutes).

I am guessing this was set to account for the fact that DV starts off with absolutely no ware production, and that player may want to buy some ships in DV - this long duration helps prevent the shipyards from draining their wares too quickly. Unfortunately it does also slow down the economy once a player does finish building DV.

It's possible to patch the aiscript file itself to make DeVries shipyards have a shorter wait time between builds, yes. But keep in mind this may have the undesirable side effect of making the DV economy run too quickly before the player can finish building the area (so you pretty much won't be able to order any ship from DV shipyards because they will always be out of resources).

Patching the aiscript file will affect the game universally (you won't be able to toggle this change on and off in-game; though you could remove the aiscript file manually before game launch if you don't want the change).

I added a poll in the OP so people can decide what they want.

Return to “X Rebirth - Scripts and Modding”