• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Preprocessor fails to translate item names

Need to look into that, at least for now it is sort of working again.
Somebody will have to check all other preprocessor use for items and adapt them to work with your new system though.
But indeed at least a working system is better than none at all. :onya
 
I am still thinking about how to do this without having to add it all to the items .... I need to make a 2 hour drive tonight so probably I will come up with an idea then.... hopefully
 
"My" version of "items.c" should be identical to the one @Levis posted here. The other two should be exactly what is in the 16th July installer.
I installed those files into my game and indeed items.c was already identical to the one I had.
Quest items all display properly, maps do not:
upload_2015-7-29_17-51-48.png


I wonder if it isn't easier to switch the maps to use the quest item method....
 
Attached two files do appear to cover all current cases properly.
Items.c uses a different system based on whether the item is a map item type or something else.
This is something I had already done for the descriptions and is now extended to the item names too.

Itemsbox.c never had any maps in it, so I applied only the system that shows the quest item preprocessors properly.

Itemstrade.c never contains any quest items, so that one remains unchanged.

This is not a "pretty" solution, but I reckon it at least works.
 

Attachments

  • itemsbox.zip
    32.5 KB · Views: 90
If you remove the getassmbled sting you will destroy the smuggle books. They relie on that ...
The files I posted before work in all cases so why not use them?
You haven't installed those but the ones grey roger posted. in mine everything works.

if you want to see if the smugglebook works call this code to get one (while on land) @Pieter Boelen :
Code:
string idbook = CreatePatrolBook(Islands[GetCharacterCurrentIsland(pchar)]);
    GiveItem2Character(pchar, idbook);

mine are included in here:
http://www.piratesahoy.net/threads/sudden-huge-amounts-of-xp-gained.24829/page-5#post-513685
 
What you say if we make a function like.
Get itemname or something like that.
What it does it first checks if a certain attribute is set (something like .AttributesCopied)
If this isn't the case it takes all preprocessor data which has the save attribute and copies it to the item (but it doesn't overwrite existing attributes).
Then a getassembled sting is called to get a complete tranlated name.
Afterwards the .AttributesCopied is set so next time it only has to do the assembled sting because it knows the attributes are already copied.
 
If you remove the getassmbled sting you will destroy the smuggle books. They relie on that ...

if you want to see if the smugglebook works call this code to get one (while on land) @Pieter Boelen :
Code:
string idbook = CreatePatrolBook(Islands[GetCharacterCurrentIsland(pchar)]);
    GiveItem2Character(pchar, idbook);
Ah, good point! I have now changed the attached files so they don't check for MAP_ITEM_TYPE but use a reversed check for QUEST_ITEM_TYPE instead.
That fixes your smuggling books without breaking anything else.

The files I posted before work in all cases so why not use them?
You haven't installed those but the ones grey roger posted. in mine everything works.

mine are included in here:
http://www.piratesahoy.net/threads/sudden-huge-amounts-of-xp-gained.24829/page-5#post-513685
I did install your latest.
There are many more quest items that use preprocessors in their description, such as these ones:
Code:
itmname_SpanishLetter   {Spanish Letter}
itmdescr_SpanishLetter
{
This document, signed by Vice-Admiral Salvatore, proves that the 'Vogelstruijs' is carrying ammunition for the conquest of #sRedmond# and is to deliver the cargo to #sSanto Domingo#.
}
Does yours work for those or would they need initItems.c to be updated as well?
If so, I don't expect anyone will do all required updates before tomorrow.... :oops:
 

Attachments

  • items.zip
    43 KB · Views: 77
Okay,this is fine with me too :), for now this should do fine. We do want to look into a better solution later...
 
Okay,this is fine with me too :), for now this should do fine. We do want to look into a better solution later...
I'm fine with your solution as long as somebody adds the necessary attributes for all items that need it. :yes
 
Nah this is okay for now. I think I know a nice way of doing it better, but first I got other stuff to handle. This works now so lets firt take more important stuff :p.
 
Back
Top