Site  •  Wiki  •  FAQ  •  Login

Money-generating Building

<<

Falchion

User avatar

Posts: 12

Joined: September 19th, 2009, 6:45 am

Location: Sao Paulo, Brazil

Post September 19th, 2009, 6:55 am

Money-generating Building

Suppose I make a mod where a faction, before it could go harvest resources (Minerals, particularly, but Gas might be also be applied), it would need to depend on buildings that generate income, and, with more built, that income would increase. How could this be possible?
"I may be called crazy, but true visionaries were always called that before their time." - Myself.
<<

TassadarZeratul

User avatar

Posts: 288

Joined: June 7th, 2009, 1:00 am

Location: Behind myself

Post September 19th, 2009, 8:08 am

Re: Money-generating Building

The easiest way would be to use triggers. Write your triggers in PyTRG and add them to your MPQ/EXE as "triggers\melee.trg".
Image
<<

Falchion

User avatar

Posts: 12

Joined: September 19th, 2009, 6:45 am

Location: Sao Paulo, Brazil

Post September 19th, 2009, 8:39 am

Re: Money-generating Building

TassadarZeratul wrote:The easiest way would be to use triggers. Write your triggers in PyTRG and add them to your MPQ/EXE as "triggers\melee.trg".


Yes, I know, I thought of that as a possibility. But exact the problem would be, what if I did it, and built that building, I'd get the income periodically, right? (Five minerals, for example.) If I build more, will it really increase or continue to spawn 5 minerals permanently?
"I may be called crazy, but true visionaries were always called that before their time." - Myself.
<<

TassadarZeratul

User avatar

Posts: 288

Joined: June 7th, 2009, 1:00 am

Location: Behind myself

Post September 19th, 2009, 8:49 am

Re: Money-generating Building

It seems like you aren't familiar with triggers. What you'd need to do is always add 1 mineral for each building the player owns. So:

Conditions:
-Current player commands at least 1 <whatever>
Actions:
-Add 1 mineral for current player
-Preserve Trigger

Conditions:
-Current player commands at least 2 <whatever>
Actions:
-Add 1 mineral for current player
-Preserve Trigger

etc. Keep going until you have a bunch of this trigger (100 should be enough), with the number increasing by 1 each time.

Or you can just use a plugin. Do you know plugins? If not I'll write it for you. I'll need to know what unit you're using as the resource producer, and at what rate you'd like minerals to be given.
Image
<<

Falchion

User avatar

Posts: 12

Joined: September 19th, 2009, 6:45 am

Location: Sao Paulo, Brazil

Post September 19th, 2009, 9:11 am

Re: Money-generating Building

Yea well, I guess 150 should be enough, lol. :P

But thanks anyway, if I need a plugin, then I know who to ask.
"I may be called crazy, but true visionaries were always called that before their time." - Myself.
<<

TassadarZeratul

User avatar

Posts: 288

Joined: June 7th, 2009, 1:00 am

Location: Behind myself

Post September 19th, 2009, 11:23 am

Re: Money-generating Building

Oh, just so you know, triggers execute once every two seconds by default. This means that you will get one mineral per two seconds per structure.
Image
<<

Hercanic

User avatar

Site Admin

Posts: 478

Joined: June 6th, 2009, 12:25 am

Location: Korea

Post September 19th, 2009, 3:39 pm

Re: Money-generating Building

To see examples of what you're asking, Lord Agamemnon's mod, Ad Astra, uses triggers to give players minerals based on how many planets they've colonized and how many of a special reactor they have. My mod, STF, uses a plugin to give players minerals based on how many Sweatshops they have and how many Engineers are loaded inside those shops.
<<

AofST

User avatar

Posts: 183

Joined: June 7th, 2009, 9:53 pm

Location: In the End of the World News

Post September 21st, 2009, 6:37 am

Re: Money-generating Building

As well as every single one of my mods. Winter's Conquest uses triggers, Temptation uses triggers and Conquer uses plugins.
Support my new site:
http://ideabirth.co.cc/
<<

Falchion

User avatar

Posts: 12

Joined: September 19th, 2009, 6:45 am

Location: Sao Paulo, Brazil

Post September 25th, 2009, 6:24 pm

Re: Money-generating Building

Okay, thanks, but can this also be applied to UMS maps? Will I have to apply this mechanics manually in UMS maps, should I decide to make one for the mod?
"I may be called crazy, but true visionaries were always called that before their time." - Myself.
<<

TassadarZeratul

User avatar

Posts: 288

Joined: June 7th, 2009, 1:00 am

Location: Behind myself

Post September 25th, 2009, 7:42 pm

Re: Money-generating Building

If you use triggers, UMS will break them. A plugin, however, will work fine on UMS.
Image

Return to [ANSWERED]

Who is online

Users browsing this forum: No registered users and 1 guest

cron
phpBBST Software