Request: A map gadget that makes area unbuildable

Request: A map gadget that makes area unbuildable

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

Moderator: Moderators

Post Reply
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Request: A map gadget that makes area unbuildable

Post by BaNa »

I am working on a unique map but i would need some way of making predefined areas unbuildable on it (teleport exits, i dont want them porced up). Can somebody lend me a helping hand or even point me in the direction?

On a related note: Is there a way to kill air units via lua?
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Request: A map gadget that makes area unbuildable

Post by Niobium »

Code: Select all

Gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced)
If cmdID is less than 0 then it's a building, cmdParams will be {x, y, z, facing} which you can use to check if it is too close to something etc. There may be a way to do this via the map itself though, like very shallow water.

And for killing air:

Code: Select all

Spring.DestroyUnit
 ( number unitID,
   [boolean selfd = false,]
   [boolean reclaimed = false,]
   [number attackerID] ) -> nil
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Request: A map gadget that makes area unbuildable

Post by BaNa »

woohoo thanks!
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Request: A map gadget that makes area unbuildable

Post by bobthedinosaur »

wall map?
User avatar
Johannes
Posts: 1265
Joined: 17 Sep 2010, 15:49

Re: Request: A map gadget that makes area unbuildable

Post by Johannes »

Niobium wrote:There may be a way to do this via the map itself though, like very shallow water.
I suggest doing that, if the map design permits. Not only is it easy to do for you, it's also very intuitive for player to see where the unbuildable area starts.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Request: A map gadget that makes area unbuildable

Post by BaNa »

The map will be a voidwater map so the only way i could do it would be with perlin noise in heightmap but that would fuck up pathing.

I will make the textures distinct and write it out in description.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Request: A map gadget that makes area unbuildable

Post by knorke »

there are some maps which do that i think..
ie that one circular map that comes up in every 3 player xta game, arctic blender or whats it called.

this one:
http://www.springfiles.com/spring/sprin ... ic-inferno
Post Reply

Return to “Lua Scripts”