[1.3] [v0.9.1-WIP] Yes, Vehicles, Finally! - Nightly build is ready for testing!

Started by NinjaSiren, February 25, 2019, 10:18:32 AM

Previous topic - Next topic

What vehicle do you want me to add?

Wheelbarrow/Wagon
15 (36.6%)
Sedan/Car/SUV
12 (29.3%)
Real vehicles?
14 (34.1%)
Motorcycle
22 (53.7%)
Red Alert vehicles?
8 (19.5%)
Comment on the forum.
2 (4.9%)

Total Members Voted: 41

dareddevil7

Having an issue where I try to make one of the vehicle weapons and the pawn finishes building it but nothing appears and the job isn't done.

As well as an issue where I'm using androids and it seems that their lack of a sleep need makes it so they are always considered to have low needs

NinjaSiren

Quote from: Hjkma on August 16, 2019, 03:21:34 PM
Well, I edited the patch and put it in Yes, Vehicles, Finally! [WIP]\Patches\CE_Patches.xml and I don't see any red errors.
Take the xml code and see if you have any errors.
https://pastebin.com/hUeTxHt7

Do I understand correctly that due to a problem with AmmoUser, the patch is not functional at the moment?

ammoUser is not the main problem. I'll check your XML.

I have checked your XML file and tested it on the following:
  • The XML file in my Yes, Vehicles, Finally!/Patches folder
  • The XML file in CombatExtended/Patches folder

1. The XML file in my Yes, Vehicles, Finally!/Patches folder.


This causes XML errors:

Pastebin: Link

2. The XML file in CombatExtended/Patches folder

Ok no problem, no bugs.

But, is it even needed, if you place the XML file in the CombatExtended/Patches folder?
It's already in the CombatExtended/Patches folder, therefore you don't need to do this, isn't it?


I also wanted to cater to people who don't want to dabble on Combat Extended, basically people who don't want to use Combat Extended, but wants vehicles in their gameplays.

[v0.83.4] [v1.0] Yes, Vehicles, Finally! - A somewhat* new way to travel the planet!

NinjaSiren

Quote from: dareddevil7 on August 16, 2019, 07:08:20 PM
1. Having an issue where I try to make one of the vehicle weapons and the pawn finishes building it but nothing appears and the job isn't done.

2. As well as an issue where I'm using androids and it seems that their lack of a sleep need makes it so they are always considered to have low needs

1. Weapons with quality that goes higher than "Good" gets a JobDriver issue, I do not know why yet. But I am into that problem currently.

2. Yes, this is actually part of the original JecsTools CompVehicle framework, and the updated [O21] Vehicle Framework. Your pawns needs to have positive moods and almost no needs just to operate vehicles.

I could not change that, as this is a dependency feature originally created by the JecsTools team. You can talk to neronix17 at Github here about this issue: Link
[v0.83.4] [v1.0] Yes, Vehicles, Finally! - A somewhat* new way to travel the planet!

Hjkma

NinjaSiren, it's strange that it caused a bunch of red errors for you, but I don't have them at all. Did you make sure that you run only 1 patch, and not two together, and that you correctly copied the contents of the patch to a file? Try to make sure that you do not have a patch in the \Combat Extended\Patches folder and try replacing the patch file in the \Yes, Vehicles, Finally! [WIP]\Patches\ folder with the file from the archive below.

The purpose of these XML codes is that they make the patch active if the CE is loaded, so the users should not care at all if they does not have CE since the patch will not be applied.



[attachment deleted due to age]

NinjaSiren

Quote from: Hjkma on August 16, 2019, 10:55:02 PM
NinjaSiren, it's strange that it caused a bunch of red errors for you, but I don't have them at all. Did you make sure that you run only 1 patch, and not two together, and that you correctly copied the contents of the patch to a file? Try to make sure that you do not have a patch in the \Combat Extended\Patches folder and try replacing the patch file in the \Yes, Vehicles, Finally! [WIP]\Patches\ folder with the file from the archive below.

The purpose of these XML codes is that they make the patch active if the CE is loaded, so the users should not care at all if they does not have CE since the patch will not be applied.

Oh ok ok, it only bugs when CE is deactivated. (My mistake!)
But still, i'll stick with my method for the meantime because not all Rimworld players use or play with Combat Extended.

I will make a CE compatible and non-CE compatible versions of the mod.
One zip file where the mod and the CE patch is inside, and a non-CE user tried this will have bugs.
[v0.83.4] [v1.0] Yes, Vehicles, Finally! - A somewhat* new way to travel the planet!

Hjkma

NinjaSiren, well, from your screenshots, I see that your patch is in the Combat Extended folder, and not in your mod, whereas you should have done the exact opposite. Place patch in \Yes, Vehicles, Finally! [WIP]\Patches\ folder and remove it from \Combat Extended\Patches\.

NinjaSiren

Quote from: Hjkma on August 16, 2019, 11:20:35 PM
NinjaSiren, well, from your screenshots, I see that your patch is in the Combat Extended folder, and not in your mod, whereas you should have done the exact opposite. Place patch in \Yes, Vehicles, Finally! [WIP]\Patches\ folder and remove it from \Combat Extended\Patches\.

Like what I said, I intended to make a CE compatible and non-CE compatible versions of the mod, where people will just extract and play. No need for deleting and adding files and stuff.

I will patch the CE version.

Done, and I will credit you for that mini-update. (I'm guessing you wanted to be part of a mod creator/patcher something?)

Link: v0.7d Release

Download:
[v0.83.4] [v1.0] Yes, Vehicles, Finally! - A somewhat* new way to travel the planet!

Hjkma

Ok, now I see that an error appears if you disable CE. It is strange that they appeared, did everything according to the example of CE patch from the Survival Tools. Here, in short, how the patch should look:
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
    <Operation Class="PatchOperationFindMod">
        <mods>
            <li>Combat Extended</li>
        </mods>
        <match Class="PatchOperationSequence">
<success>Always</success>
            <operations>
                <!-- patch here -->
</operations>
</match>
</Operation>
</Patch>

And the patch was edited that way. I don't understand why the error is here, maybe the more experienced mod developers can tell what the problem is.

NinjaSiren

Quote from: Hjkma on August 16, 2019, 11:52:11 PM
Ok, now I see that an error appears if you disable CE. It is strange that they appeared, did everything according to the example of CE patch from the Survival Tools. Here, in short, how the patch should look:
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
    <Operation Class="PatchOperationFindMod">
        <mods>
            <li>Combat Extended</li>
        </mods>
        <match Class="PatchOperationSequence">
<success>Always</success>
                       <operations>
                            <!-- patch here -->
</operations>
</match>
</Operation>
</Patch>

And the patch was edited that way. I don't understand why the error is here, maybe the more experienced mod developers can tell what the problem is.

You use CE, how about people who don't use or like to use CE?

Your update code works, problem is how about people who do not use CE? They will get errors.
You don't get that XML codes will not solve the issue of when CE is disabled, the game will get errors.

From the Swimming Kit mod, how to properly patch a mod for another mod:

https://ludeon.com/forums/index.php?topic=46366.0

That will fix our problem here, even if CE is disabled (or non-existent in the mod list) It will work, problem it's a C# thing.

XML <patch> files will not fix the issue even if with <Operation Class="PatchOperationFindMod"> in it, because it will always try to find Combat Extended enabled in your mod list.

I get your point, and perspective. Problem is people who do not use Combat Extended, they will get errors because they don't have Combat Extended.
[v0.83.4] [v1.0] Yes, Vehicles, Finally! - A somewhat* new way to travel the planet!

Hjkma

But the Survival Tools mod does not cause any red errors if Combat Extended is not loaded, and as you can see in this mod the patch for CE was written in this way. The error is somewhere else, perhaps the operations themselves are incorrectly written.
See the example again, everything is done as this way:
https://github.com/XeoNovaDan/SurvivalTools/blob/master/1.0/Patches/CombatExtended/Patch.xml

NinjaSiren

Quote from: Hjkma on August 17, 2019, 12:14:18 AM
But the Survival Tools mod does not cause any red errors if Combat Extended is not loaded, and as you can see in this mod the patch for CE was written in this way. The error is somewhere else, perhaps the operations themselves are incorrectly written.
See the example again, everything is done as this way:
https://github.com/XeoNovaDan/SurvivalTools/blob/master/1.0/Patches/CombatExtended/Patch.xml

Survival Tools team got C# and XML codes in there mod possibly.

Try disabling CE with Yes, Vehicles enabled. You will experience errors.

There, I found the C# codes for Survival Tools compatibility for CE (Using ilspy for checking .dll files):





without this codes, Survival tools will not be compatible, even with XML-based patches in the mod.

I will not dabble yet with C# for the meantime.
[v0.83.4] [v1.0] Yes, Vehicles, Finally! - A somewhat* new way to travel the planet!

Hjkma

I found the Pulsefire Turret mod with an internal patch for CE. https://steamcommunity.com/sharedfiles/filedetails/?id=1712142869&searchtext=
It does not use any dll and C# code respectively, consists only of XML and png files, and also has no dependencies. I checked this mod with the Combat Extended on and off, and no red errors appeared at all. The Pulsefire patch also has the same XML structure as in the Survival Tools patch.

Also the mod Vanilla Weapons Expanded CE Patch https://steamcommunity.com/sharedfiles/filedetails/?edit=true&id=1819425140

There are no dll, everything is entirely xml files.

So the point is rather not in C#, but in the operations of the patch, maybe something is not written right, you can request help on the forum in the Help section or in the Rimworld Discord in the #mod-development channel to figure out how to properly patch mods for CE.

NinjaSiren

Quote from: Hjkma on August 17, 2019, 05:07:43 AM
I found the Pulsefire Turret mod with an internal patch for CE. https://steamcommunity.com/sharedfiles/filedetails/?id=1712142869&searchtext=
It does not use any dll and C# code respectively, consists only of XML and png files, and also has no dependencies. I checked this mod with the Combat Extended on and off, and no red errors appeared at all. The Pulsefire patch also has the same XML structure as in the Survival Tools patch.

Also the mod Vanilla Weapons Expanded CE Patch https://steamcommunity.com/sharedfiles/filedetails/?edit=true&id=1819425140

There are no dll, everything is entirely xml files.

So the point is rather not in C#, but in the operations of the patch, maybe something is not written right, you can request help on the forum in the Help section or in the Rimworld Discord in the #mod-development channel to figure out how to properly patch mods for CE.

Look,

Fig. 1 - Yes, Vehicles, Finally!/Patch folder (2 XML patch files)


Fig. 2 - Yes, Vehicles, Finally!/Patch folder (No XML patch files)


Fig. 3 - Wall of patch errors.


Fig. 4 - Mod load order, Combat Extended removed.


Fig. 5 - Code inside the CE_Patch.xml


Errors still appear. That's the patch with the:
<Operation Class="PatchOperationFindMod">
        <mods>
            <li>Combat Extended</li>
        </mods>
        <match Class="PatchOperationSequence">
            <success>Always</success>
            <operations>
            ...
            </operations>
       </match>
</Operation>


Speaking of the Pulsefire Turret mod, I found a .dll file named ModCheck in its Assembly folder, and found interesting codes that connects the C# and XML codes together that allows automated compatibility between Pulsefire and some other mod (in our case Combat Extended).

Checks if a specific compatible mod is loaded:


Checks if the loaded mod is incompatible:


Checks the mod load order of Pulsefire versus the specific mod loaded:


Most important of all, the one that loads XML patch operations of that specific mod loaded:


And for Vanilla Weapons Expanded CE Patch, it's actually similar to what I do originally where there is a separate mod/file for the Combat Extended patch.

Main mod:
Vanilla Weapons Expanded

The patch required for CE compatibility:
Vanilla Weapons Expanded CE Patch

If you are scared or worried that this mod will go back to being not updated, I will still update and add features in it.

For me currently, CE compatibility is ok and I don't have the problem on the method I use and the method you added after the fact.

I will remain standing on my methods until Combat Extended updates and or I have free time to make a C# .dll based patch with the XML patch files.
[v0.83.4] [v1.0] Yes, Vehicles, Finally! - A somewhat* new way to travel the planet!

Hjkma

In Pulsefire mod, there are no dll files here. I don't know what kind of github repository it is, but this archive  does not contain dll files and I play with this mod and activated it without Combat Extended and there were no errors at all.

According to Vanilla Weapons Expanded CE Pathc, as you can see, everything is done through own Patches folder and theoretically, nothing prevents merging these files with the main mod and everything will work the same way.




[attachment deleted due to age]

NinjaSiren

Quote from: Hjkma on August 17, 2019, 07:34:31 AM
In Pulsefire mod, there are no dll files here. I don't know what kind of github repository it is, but this archive  does not contain dll files and I play with this mod and activated it without Combat Extended and there were no errors at all.

According to Vanilla Weapons Expanded CE Pathc, as you can see, everything is done through own Patches folder and theoretically, nothing prevents merging these files with the main mod and everything will work the same way.

Can I see your in-game console when CE is disabled and Yes, Vehicles, Finally! is running?


Ok ok, the mod works without CE, problem I still get the wall of errors when I run the game. Basically, ignore the wall of errors. (non-critical errors)

Sorry if this forum went into us getting irritated, thank you. Don't you worry you will be credited on the updates.
[v0.83.4] [v1.0] Yes, Vehicles, Finally! - A somewhat* new way to travel the planet!