It is currently 28 Mar 2024, 12:36

WELCOME TO SIMUSCAPE!


Please Sign in or Register to enable all features, remove restrictions and gain additional access!
For information on how to bypass the CAPTCHA or to contact Team Simuscape, Continue Here!


Post a new topicPost a reply Page 2 of 2   [ 26 posts ]
Go to page Previous  1, 2
Author Message
PostPosted: 14 Aug 2017, 13:59 
Browser
Browser
User avatar

Joined: 04 Mar 2012, 10:10
Posts: 229
wallyweb wrote:
kamnet wrote:
My intent with this is to not only define new names but currency rates as well. I actually want to push the specs to see how flexible it is.
OK ... I'll be doing some experimenting. Seeing as how the pound is the standard, I will not be touching that one.
GRFSpecs wrote:
TTD always uses British pounds for internal calculations.
This might take a while.


It really shouldn't be complicated. According to the documentation, the default value should be "1000". Any other currency that you define will be 1000 or greater. So if you set it at 2000 then that means your currency is 1:2 with GBP/OpenTTD, 3000 is 1:3, etc. I have been told that this number always has to be a multiple of 1000, because otherwise OpenTTD will ignore it. Nobody has ever tested that before, as far as I can tell. So I'd like to work with the code and see if I can't get a fractional ratio, and also test if I can make the ratio work lower than 1:1, for example define the currency at 500 so I get a 1:0.5 ratio.


Top
 Offline Profile  
 
PostPosted: 14 Aug 2017, 17:33 
Master Mentor
User avatar

Joined: 27 Feb 2012, 22:45
Posts: 1880
Location: Canada
kamnet wrote:
It really shouldn't be complicated. According to the documentation, the default value should be "1000". Any other currency that you define will be 1000 or greater. So if you set it at 2000 then that means your currency is 1:2 with GBP/OpenTTD, 3000 is 1:3, etc. I have been told that this number always has to be a multiple of 1000, because otherwise OpenTTD will ignore it. Nobody has ever tested that before, as far as I can tell. So I'd like to work with the code and see if I can't get a fractional ratio, and also test if I can make the ratio work lower than 1:1, for example define the currency at 500 so I get a 1:0.5 ratio.
:x Now you tell me. :lol:
You're too late. :mrgreen:
I've been pounding on this all morning and figured it out a couple of hours ago.. 8-)
TTDP does do the fractionals but OTTD doesn't. They use different algorithms.

For both TTDP and OTTD, the game options accessed from the splash screen will always show the defaults currencies.
You have to access the game options from inside the game.
The menu is alphabetical.
To keep your stuff easily visible just insert a space before the name.

The zip includes the grf and the nfo.
Here's the nfo that is in the zip:
Code:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>>
// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C
// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D%
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
    0 * 4    09 00 00 00
    1 * 16    14 "CINFO"
                 "BPALS" 01 00 "A"
                 00
             00

    2 * 121    08 07 "KF" 09 01 "Simoleon Currency" 00 "V2 Custom currency based on the video games SimCity and The Sims. Code by Kevin Fields (kamnet)." 00

    // Let's name our currency
// <Sprite-number> * <Length> 04 <feature> <language-id> <num-ent> <offset> <text>
    3 * 23    04 48 FF 01 01 DC " Simoleons (SIM)" 00
    4 * 22    04 48 FF 01 02 DC "Simoleons (SIM)" 00
    5 * 19    04 48 FF 01 03 DC " Loony (LOO)" 00
    6 * 18    04 48 FF 01 04 DC "Loony (LOO)" 00
    7 * 19    04 48 FF 01 05 DC " Twony (TWO)" 00
    8 * 18    04 48 FF 01 06 DC "Twony (TWO)" 00
// Don't ask. A few years ago the CDN $1 bill was replaced by a coin that had an image of a Loone.
// It was nicknamed the Loony.
// After that the CDN $2 bill was replaced by a coin and naturally it was nicknamed the Twony.
// Our economy has been loony twony ever since.
// dabadana dats all folks.

// <Sprite-number> * <Length> 00 <Feature> <Num-props> <Num-info> <Id> (<Property <New-info>)...
    // Property 0A: Reference currency name here
    // Property 0B: Set the currency multipliers here
    // Property 0C: Set the value separator
    // Property 0D: set the currency symbol as <symbol>+<space>
    // Property 0E: set the currency symbol as <space>+<symbol>

    9 * 106    00 08 05 06 01 
         0A 01 DC  02 DC  03 DC  04 DC  05 DC  06 DC
         0B E8 03 00 00  D0 07 00 00  \d500  F4 01 00 00  \d1500  DC 05 00 00
         0C 00 2C  00 2C  00 2C  00 2C  00 2C  00 2C 
         0D "J " 00 00  4A 20 00 00  "# " 00 00  20 23 00 00  "TWO "  20 4F 57 54
         0E " J" 00 00  20 4A 00 00  " #" 00 00  23 20 00 00  " TWO"  4F 57 54 20

And they said it couldn't be done. Fake News. Big time. :lol:
Let me know how it goes. We will take questions at the press conference. ;)


Attachments:
Simoleons.zip [1.54 KiB]
Downloaded 331 times

_________________
Visit SimuSchool - Tutorials, Questions and Answers
TTDPatch Nightlies Downloads are back
Thrive
Top
 Offline Profile  
 
PostPosted: 14 Aug 2017, 23:11 
Browser
Browser
User avatar

Joined: 04 Mar 2012, 10:10
Posts: 229
Sweet! I'll have to do a more thorough review of the code later to see where I wasn't quite getting it right.

My next task - creating custom glyphs to represent currency symbols not in unifont!


Top
 Offline Profile  
 
PostPosted: 16 Aug 2017, 21:37 
Master Mentor
User avatar

Joined: 27 Feb 2012, 22:45
Posts: 1880
Location: Canada
kamnet wrote:
My next task - creating custom glyphs to represent currency symbols not in unifont!
You might need somebody to write a patch to support that. That's beyond the rev used by my brain. :sorry:

_________________
Visit SimuSchool - Tutorials, Questions and Answers
TTDPatch Nightlies Downloads are back
Thrive


Top
 Offline Profile  
 
PostPosted: 17 Aug 2017, 07:56 
Browser
Browser
User avatar

Joined: 04 Mar 2012, 10:10
Posts: 229
wallyweb wrote:
kamnet wrote:
My next task - creating custom glyphs to represent currency symbols not in unifont!
You might need somebody to write a patch to support that. That's beyond the rev used by my brain. :sorry:


Well according to spec I just need to put it into a sprite sheet and reference it. In theory, anyhow.


Top
 Offline Profile  
 
PostPosted: 17 Aug 2017, 13:09 
Master Mentor
User avatar

Joined: 27 Feb 2012, 22:45
Posts: 1880
Location: Canada
kamnet wrote:
Well according to spec I just need to put it into a sprite sheet and reference it. In theory, anyhow.
ok ... I assume that this needs Action 12 - Adds Unicode font glyphs,
This goes beyond my level of expertise.
Someone who is familiar with fonts and Action 12 would be best for your needs.
Keep me posted as to how it is done. 8-)

_________________
Visit SimuSchool - Tutorials, Questions and Answers
TTDPatch Nightlies Downloads are back
Thrive


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 2 of 2   [ 26 posts ]
Go to page Previous  1, 2


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Status SimuscapeTerms of UseAbout Simuscape

Design by SAC © 2012-2015, Sweden • Powered by phpBB • Based on twilightBB by Daniel St. Jules