• 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!

Need Help Help write new function

Myth

Freebooter
Good afternoon. I would be grateful for the help in writing the new feature. That's the point. You need to specify how many characters to cut off from any word and where to start the countdown: from the first or last letter. For example. I ask:
Variable "nickname." Remove the first four letters. In the end, I'll get a "name."
Thank you for your help.
 
I think I've seen some functions in the PotC Build Mod that do stuff like that.
Maybe... utils.c and then search for "Maximus"?
 
Are you talking about New Horizons? If not, I don't know what you're talking about. Can I have the file I need in my own right?
 
New Horizons makes several references to a function 'strcut(string str, int start, int stop)'. I believe that may be a native function, and looking through some GoF code, it seems to be used there. If so, you already have it built into the game!

There's also function 'strlen(str)' which gives the length of the string, so if you want x characters from the end, you'd use:
Code:
strcut(variable, strlen(str) - x, strlen(str) -1)
 
Back
Top