Automatic metal maker

Automatic metal maker

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
smoke_th
Posts: 140
Joined: 25 May 2010, 13:15

Automatic metal maker

Post by smoke_th »

Here is question. How make in lua unit file (that replaces fbi) changes that it will use as metal income value 1/10 of wind on map? And also add 1/10 energy income from wind? I'm kinda stuck with it =\
Image
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: Automatic metal maker

Post by KaiserJ »

no idea, but i like this model :D
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Automatic metal maker

Post by CarRepairer »

I made a similar model:

Image
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Automatic metal maker

Post by Pxtl »

You'll have to Lua it. The CA guys are good at making resource-generating units that work weird, ask them. For example, you could make the wind-generation really tiny and then read the energy-generation value to determine your metal making.

@CR - okay, that's just funny. But being a CA guy, wouldn't you have actually *useful* input?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Automatic metal maker

Post by zwzsg »

Spring.GetUnitResources
( number unitID ) -> nil | number metalMake, number metalUse,
number energyMake, number energyUse


Spring.SetUnitResourcing
( number unitID,
string res, number amount |
{ res = number amount, ... }
) -> nil
possible values for res are: "[u|c][u|m][m|e]"
unconditional | conditional
use | make
metal | energy


Or do I have to write the whole gadget?
User avatar
smoke_th
Posts: 140
Joined: 25 May 2010, 13:15

Re: Automatic metal maker

Post by smoke_th »

zwzsg wrote:Spring.GetUnitResources
( number unitID ) -> nil | number metalMake, number metalUse,
number energyMake, number energyUse


Spring.SetUnitResourcing
( number unitID,
string res, number amount |
{ res = number amount, ... }
) -> nil
possible values for res are: "[u|c][u|m][m|e]"
unconditional | conditional
use | make
metal | energy


Or do I have to write the whole gadget?
Hmm.....interesting....but can you next time wrote it more understandably? And where i need to put this code? I doesn't look like standart tdf-looking lua file with...
unitDef = {
unitname = [[scv]],
name = [[scv]],
description = [[scv]],
acceleration = 0.36,
bmcode = [[1]],
brakeRate = 0.2,
buildCostEnergy = 65,
buildCostMetal = 65,
builder = false,
buildPic = [[bbasicmech.png]],
buildTime = 15,
canAttack = true,
canGuard = true,
...
User avatar
smoke_th
Posts: 140
Joined: 25 May 2010, 13:15

Re: Automatic metal maker

Post by smoke_th »

CarRepairer wrote:I made a similar model:

Image
Flying bertha? Man, you are cheater :D
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Automatic metal maker

Post by FLOZi »

It has to be done in a LuaRules gadget, not the unitdef itself. That is what zwzsg's (incomplete) code is for.
Post Reply

Return to “Game Development”