News:

Currently available MegaGlest gameservers are listed on Play.MG.

Main Menu

[done]Lock units in scenarios (lua)

Started by titi_son, 15 November 2014, 18:16:28

titi_son

I think it would be nice to have a function to block units in scenarios.

Like you need to reach this objective to unlock this unit. I made a scenario using this feature: DOWNLOAD
You need to checkout titison/megaglest-source/tree/feature/lua_blockUnits to try :P

Syntax is

setLockedUnitForFaction(unitName,FactionIndex,1=true;0=false)
--Lock the unit
setLockedUnitForFaction('battlemage',0,[color=red]1[/color])
--Unlock the unit
setLockedUnitForFaction('battlemage',0,[color=red]0[/color])


Please correct me (and my pull request) if this is wrong but i think MegaGlest can't read boolean values from lua or there arent any real bools in lua
Or does this even work with true and false? i dont think so.

Of course you can do this already with some kind of hidden upgrade for example but you need a new techtree for this and its inconvenient.
Do you think this is a good idea or just needless stuff?

Pull Request

EDIT:There is a bug i need to fix before you merge this pull request. ( not saved in savegames i think ) fixed
My first Tilseset: SPRING :) (included in Megaglest )


Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

softcoder

Yes we stick to using int for booleans as I think i saw that using booleans gave unpredictable results.

Thanks

titi

I think this feature is useful and I would like to merge it.
Anyone else wants it ?



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios