Page 1 of 2
Giving metal with lua script?
Posted: 27 Aug 2009, 02:00
by TradeMark
Is it possible to make lua script that gives you, for example 10k metal once at the start of the game? since TASClient doesnt support more than 10k m/e, so im thinking if i could override that with lua... and without making new mod/mutator...
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 02:05
by momfreeek
err.. if you could do this in a widget, wouldn't that make it a little bit too easy to cheat? Caydr would die from rage.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 02:19
by smoth
TradeMark wrote:Is it possible to make lua script that gives you, for example 10k metal once at the start of the game? since TASClient doesnt support more than 10k m/e, so im thinking if i could override that with lua...
Sure you can. LRN TO MOD OPTIONS
TradeMark wrote:and without making new mod/mutator...
NOPE
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 02:32
by Argh
You can absolutely do this, and it doesn't take a mod option, just a simple Gadget to adjust your storage. However, it's still just a mutator-only option.
I adjust starting M/E in P.U.R.E., for example.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 03:31
by smoth
that would be a hard set value. It would be more flexible as a mod option.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 03:47
by Noruas
Is there anyway to make where killing units can overall increase the economy a unit produces, like killing 20 units add 1 percent to overall energy and metal production.
If your team kills 100 units your commander gets a 5 percent bonus in <insert your thing here>
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 03:51
by FLOZi
smoth wrote:that would be a hard set value. It would be more flexible as a mod option.
S44 has this.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 05:23
by smoth
FLOZi wrote:S44 has this.
I have to wonder why such things are even part of the Lobby interface and not just covered by mod options. Funny how that backwards shit can cause such issues.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 05:41
by FLOZi
smoth wrote:FLOZi wrote:S44 has this.
I have to wonder why such things are even part of the Lobby interface and not just covered by mod options. Funny how that backwards shit can cause such issues.
I tend to agree.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 13:43
by TradeMark
hmm, so i need mutator...
would it be then possible to make a map which has gadget that spawns each player 1 unit which generates 10k metal per second, and then selfdes it right after you got the metal?
i would change commander metal storage to 20k for example...
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 14:49
by Tobi
You could just make a map with a gadget that does nothing but give you 10k metal on the start.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 15:04
by momfreeek
anything you can do in a mutator you can do in a map right? (cause you could just put the whole mod in a map)
except modoptions maybe...
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 15:42
by zwzsg
momfreeek wrote:err.. if you could do this in a widget, wouldn't that make it a little bit too easy to cheat? Caydr would die from rage.
Learn the difference between Lua gadget and Lua widget.
momfreeek wrote:except modoptions maybe...
MapOptions.lua
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 15:53
by momfreeek
zwzsg wrote:momfreeek wrote:err.. if you could do this in a widget, wouldn't that make it a little bit too easy to cheat? Caydr would die from rage.
Learn the difference between Lua gadget and Lua widget.
He was asking for a way to do it with lua but 'without making new mod/mutator'. That pretty much = widget doesn't it? (Apart from including a gadget in a map)
Check the context before you jump to conclusions about what someone said.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 15:59
by zwzsg
TradeMark is known for making rehashes of maps named "Speed Balls" with free fusion. So it's easy to guess that the context is, for new maps he's making. And map can use gadgets.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 15:59
by Argh
You can't do it with a Widget.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 16:01
by zwzsg
This should have been so obvious that we wouldn't have to discuss it.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 16:06
by momfreeek
zwzsg wrote:TradeMark is known for making rehashes of maps named "Speed Balls" with free fusion. So it's easy to guess that the context is, for new maps he's making. And map can use gadgets.
This was less than obvious to me. He didn't say anything about maps.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 16:10
by Argh
Yeah, yeah. I guess it isn't totally obvious.
Basically, guys... Widgets aren't allowed to alter gamestate. Read it, yeah. Do funny things with OpenGL to react to what data they read, sure. Write? No. Get it?
If you want to write it, you need a Gadget, or a modOption, which is effectively the same thing, only it's more fun for end-users.
If it's a modOption, don't stick it into a map, unless you only want it played with one mod, because it will probably break other mods (IIRC, there isn't a good way to insert a modOption into that table, but I may be totally wrong). Otherwise, use a Gadget. Then you'll just break mods that also do this kind of thing.
Re: Giving metal with lua script?
Posted: 27 Aug 2009, 16:13
by momfreeek
I know:
widgets are unsynced
gadgets are synced/unsynced
what you can do in unsynced code is necessarily restricted
meh, i was really just a joke anyway. I just imagined Caydrs reaction if it was possible in a widget :p