Giving metal with lua script?

Giving metal with lua script?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Giving metal with lua script?

Post 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...
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: Giving metal with lua script?

Post 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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Giving metal with lua script?

Post 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
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Giving metal with lua script?

Post 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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Giving metal with lua script?

Post by smoth »

that would be a hard set value. It would be more flexible as a mod option.
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Re: Giving metal with lua script?

Post 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>
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Giving metal with lua script?

Post by FLOZi »

smoth wrote:that would be a hard set value. It would be more flexible as a mod option.
S44 has this.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Giving metal with lua script?

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Giving metal with lua script?

Post 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.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Giving metal with lua script?

Post 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...
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Giving metal with lua script?

Post by Tobi »

You could just make a map with a gadget that does nothing but give you 10k metal on the start.
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: Giving metal with lua script?

Post 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...
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Giving metal with lua script?

Post 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
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: Giving metal with lua script?

Post 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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Giving metal with lua script?

Post 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.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Giving metal with lua script?

Post by Argh »

You can't do it with a Widget.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Giving metal with lua script?

Post by zwzsg »

This should have been so obvious that we wouldn't have to discuss it.
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: Giving metal with lua script?

Post 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.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Giving metal with lua script?

Post 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.
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: Giving metal with lua script?

Post 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
Post Reply

Return to “Lua Scripts”