Closed tater99 closed 9 years ago
No, you can not expect that the files in SoilManagement.ZIP be "fixed forever".
What are your scripts doing? - If they only register the fruit-/spray-/fill-types, then please don't. - It should not be a "placeable"s responsibility to register new fill-types, only "use them".
New fruit-/spray-/fill-types should, IMO, only be registered by the map-mod itself (in its SampleModMap.LUA) or by indirection like SoilMod (which automatically adds extra code to the SampleModMap-script's loading methods.)
Though if your scripts are referring to the fill-type icons, because of custom overlay drawing on the screen, then you could instead just "grab" the icon from the Fillable.fillTypeIndexToDesc
table:
local fillType = Fillable.FILLTYPE_FERTILIZER2
local overlayFilename = nil
-- Ensure that there actually is registered the specific fill-type
if fillType ~= nil then
overlayFilename = Fillable.fillTypeIndexToDesc[fillType].hudOverlayFilename
end
-- Use the file-name, if it was found
if overlayFilename ~= nil then
-- Either
-- fillOverlay = Overlay:new("name", overlayFilename, x,y,w,h)
-- fillOverlay:render()
-- or
-- fillOverlay = createImageOverlay(overlayFilename)
-- renderOverlay(fillOverlay, x,y,w,h)
end
Thank you for the response.
The tanks and triggers are installed on the map in GE (not placeable)
I made a simple script to register the new fillTypes from SoilMod on the map. Without this, the new fillTypes are not recognized properly.
The script also had to specify a hud icon for these fillTypes, or none would be displayed.
(I was also able to accomplish this by using additionalFruitTypes.lua and adding the necessary entries in the map modDesc. And making my own hud icons in the map mod. It is just easier for map makers to use my script.)
I will just update the script as needed when new versions of SoilMod are released.
Regards, tater
Hmm. So loading the map, and before SoilMod is initialized, the filltypes needs to be known. I'll try to figure something out, as it is IMO not good practice to register the same fill-types multiple times.
Try use the v2.0.26 without your script. Please let me know if it works or not.
2.0.26 works great without the script.
Thank you very much for the fix. Apologies for being a pain in the butt and causing you extra work.
Closing this.
Greetings, Decker
I noticed that the names of the hud images for fill types have changed in ver. 2.0.25. Do you think that these new image names will stay as-is in possible future versions?
I ask because my own script for individual fill type triggers points to the hud dds images in SoilManagement.zip. Making my own hud images is an option, but I like the ones in SM just fine.
If the hud dds names are finalized now, I will just wait for SM ver. 2.0.25 or greater to go public before I release my SM tanks map objects.
Thanks, tater