Mobile Mexes v3 final [updated]

Mobile Mexes v3 final [updated]

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

Moderator: Moderators

Post Reply
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Mobile Mexes v3 final [updated]

Post by jK »

This luaRule allows mobile metal extractors
In particular, it assigns ANY* unittype an invisible metal extractor.

Image
luaRule + PressureLine's bmobmex(updated)
video

The script has a config file, so you can edit it easily to your needs.
So you can switch between 2 modes: always extract and a button handled extraction (the unit can't move then while extracting). Also it calls the COB events "MexDeploy"+"MexPackUp", so you can react on walk<->extraction changes.
If you want to use the new COB->lua interface, you need a working luaCOB folder and then you can call in your cob-script "lua_ChangeMexState(TRUE|FALSE)" and don't forget the fake luaCob function. For examples see PressureLine's bmobmex, which is included.
Of course, you can edit the extraction power and range.
(and yes the unit which the mexe is assigned to shows the metal extraction)

Note: To use the script you need a working luaRules folder (if you don't have one you should extract complete annihilation). Only if you want to use the COB->lua interface you need a working luaCob folder, too. And don't forget to change the default (hidden) metal extractor in the config file, if your mod don't have the armmex.

*except metal extractors itself! ->the choosen unittype which should be able to move must NOT extract metal itself. The metal extracts another hidden unit (normally an armmex) and copy the metal stats to the visible unit. btw you can change the extraction stats of the hidden mexe in the config file, so the hidden unit can be an armmex but have got the extraction strength of a moho mine.

changelog v2->v3:
*the hidden mexes are now gaiaTeam units. that fix the unitlimit problem and destroyed mobile mexes don't count as 2 units in the statistics anymore, also it cleans up your ressource bar alot (no +(double income) -(income) anymore ;))

changelog v1->v2:
*Because renames, it is recommend to delete the old gadget+config before you install the new version!
*fixed a problem with uppercases in unitnames
*add PressureLine's shiny bmobmex
*fixed wrong shown metal income
*renamed the cob interfaces
*add a cob->lua interface



Special tanks to: PressureLine for the idea + the pretty bmobmex <3
Last edited by jK on 18 Aug 2007, 09:01, edited 7 times in total.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

oh man. i love you.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

/me goes to mangle the MTR wiki page
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Moving Mexes LuaRule

Post by Pressure Line »

*edit* beaten by foxo
Last edited by Pressure Line on 29 Jul 2007, 01:15, edited 1 time in total.
User avatar
Foxomaniac
Posts: 691
Joined: 18 Jan 2006, 16:59

Post by Foxomaniac »

User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Moving Mexes LuaRule

Post by Pressure Line »

jK wrote:In particular it allows metal extractors to move
This is very important. jK should get many lovings for this.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

What happens when you hit the unit limit?
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

try killing the other player... that usually works for me
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

i cannot seem to get this to work with my mobile mex unit, although oddly enough it works with EVERY other unit ive tried.

serious wtfage going on here
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Post by Noruas »

I noticed this too, i think it has something to do with the length of the name of the unit. I dunno why it works sometimes and sometimes just ignores other units.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

Noruas wrote:I noticed this too, i think it has something to do with the length of the name of the unit. I dunno why it works sometimes and sometimes just ignores other units.
im not 100% sure whether it is the name length. since it worked fine with blightveh (9 chars), but not with bmobmex (7 chars)
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

could you send me the corresponding mod or better say which mod (and unit) on uf has this problem, so i could fix it?
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

jK wrote:could you send me the corresponding mod or better say which mod (and unit) on uf has this problem, so i could fix it?
easier if i just upload the unit and you add it into the UP 2.1A sd7, since theres a lot of random rubbish in my dev version

*edit* i'll also be giving it a try for BZS tonight, will let you know how it goes
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

works fine with the scavenger from battlezone :/

i did notice a bit of a but, that being that when the mobile mex unit is selected, it only displays a fraction of the metal amount being extracted (the full amount as calculated from the resource bar is correct, but only ~1/3 is being displayed on the mobile portion of the unit), will post screens when i get home
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

i fixed both of your problems: it works now on all units (it was a problem with uppercases in unitnames) and the M income is now correct.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

:idea: new version
User avatar
Tired
Posts: 302
Joined: 14 Nov 2005, 07:19

Post by Tired »

Is it just me, or could E&E really use this? ~~
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

probably. i also have code to stop hovering ones from extracting while over water ^_^
User avatar
[XIII]Roxas
Posts: 182
Joined: 20 Jun 2007, 23:44

Post by [XIII]Roxas »

Think: Final Frontier Colony Ships.
Post Reply

Return to “Lua Scripts”