Page 1 of 7

Mood is a thing for

Posted: 27 Jan 2012, 13:42
by zoggop
cattle and loveplay,

http://springfiles.com/downloadmain/15741
http://springfiles.com/spring/spring-ma ... d-loveplay

Image

Image

not fighting!

Unfortunately I couldn't get the sand dunes to be bumpy enough to block building construction yet smooth enough to allow vehicle passage. (I opted for the latter over the former.)

Re: Mood is a thing for

Posted: 27 Jan 2012, 16:09
by Pxtl
Oooh, so *that's* why you wanted terrain that blocked buildings.

Re: Mood is a thing for

Posted: 27 Jan 2012, 16:29
by Cheesecan
Nice map!

Re: Mood is a thing for

Posted: 27 Jan 2012, 16:38
by Pxtl
So if you didn't want players to construct buildings on the sand, how did you expect them to harvest those spice-patches that are out there?

Re: Mood is a thing for

Posted: 27 Jan 2012, 17:37
by maackey
is it possible to have lua spawn giant worms that eat any buildings that are built upon the sand? :wink:

Re: Mood is a thing for

Posted: 27 Jan 2012, 17:38
by Pxtl
Right now zwszg is currently rummaging through his old files to find that one gif.

Re: Mood is a thing for

Posted: 27 Jan 2012, 17:48
by knorke
Unfortunately I couldn't get the sand dunes to be bumpy enough to block building construction yet smooth enough to allow vehicle passage.
you could block by terrain height (blabla zK terraforming blabla)

Re: Mood is a thing for

Posted: 27 Jan 2012, 21:21
by zoggop
knorke wrote:you could block by terrain height (blabla zK terraforming blabla)
Really? How does one do that?
is it possible to have lua spawn giant worms that eat any buildings that are built upon the sand?
Were someone to model a sandworm head, I would be tempted into making it eat things with Lua.

So if you didn't want players to construct buildings on the sand, how did you expect them to harvest those spice-patches that are out there?
Weell, I guess that's why slope seemed the only way--because "spice" extractors can be built on just about any steepness.

Re: Mood is a thing for

Posted: 27 Jan 2012, 21:49
by knorke
you could block by terrain height (blabla zK terraforming blabla)
Really? How does one do that?

Code: Select all

AllowUnitCreation(unitDefID, builderID, builderTeam, x, y, z)
if y > maxHeight then return false else return true
end
(add some extra if's to always allow mex, terraforming or w/e)

Re: Mood is a thing for

Posted: 28 Jan 2012, 03:38
by zoggop
Making a gadget to block all buildings except for metal extractors on sand (using the typemap) was shockingly easy, thanks to knorke's examples.

Code: Select all

function gadget:AllowUnitCreation(unitDefID, builderID, builderTeam, x, y, z)
   if (not builderID) then return true end   --no builder -> morph or something like that
	if UnitDefs[unitDefID]["extractsMetal"] > 0 then return true end
	local groundType, _ = Spring.GetGroundInfo(x, z)
	if groundType == "Sand" then
		Spring.Echo("Only metal extractors can be built on sand.")
		return false
	end
   return true
end
Of course, poor AIs will be totally confused by this. Any other suggestions? If anyone wants a map package with this build-blocking gadget, I'll post it.

Re: Mood is a thing for

Posted: 28 Jan 2012, 05:23
by knorke
Of course, poor AIs will be totally confused by this.
could use Spring.GetTeamInfo to allow AIs to build anywhere.
Maybe also always allow the creation of gaiea (neutral team) units as some games might use that for various things.

Please make a map with that, always wanted to make/play such map but do no like going heightmap/texturing.

Re: Mood is a thing for

Posted: 28 Jan 2012, 06:31
by zoggop
Have been fiddling with the gadget... I added an "if it's a building" test ("isBuilding" in UnitDefs), which in BA has the somewhat confusing consequence of being able to build nano turrets on the sand, and not being able to build mines on the sand. I could fix that by making specific name-based if statements, but that may not work for other games. Also I'm making it a map option.

Re: Mood is a thing for

Posted: 28 Jan 2012, 10:24
by zoggop
Before I put a bunch of changes into version 2... how do I get "receivetracks=0;" in the SMD to actually do anything? I've tried "recievetracks" as in http://springrts.com/wiki/Maps:SMD, and the correct spelling. Neither seem to do anything (it defaults to receiving tracks).

Re: Mood is a thing for

Posted: 28 Jan 2012, 10:52
by knorke
It is def. "receiveTracks" (so that wiki page is wrong)
https://github.com/spring/spring/blob/d ... o.cpp#L380

I suspected it is maybe loaded and never used but in GroundDecalHandler.cpp there is an if for that.

Re: Mood is a thing for

Posted: 28 Jan 2012, 12:21
by SirArtturi
These dunes look so awesome! I think nobody has made a 'real' desert yet, so this might be interesting map to play.

But for v2, please, redo the metal spots. They ruin your otherwise fantastic looking map! Could you do regular looking spot, subtle ones, so that they blend into your landscape?

Re: Mood is a thing for

Posted: 28 Jan 2012, 17:16
by Beherith
If one cant build on dunes, how does one cap mexes in sand?

Re: Mood is a thing for

Posted: 28 Jan 2012, 19:18
by zoggop
Beherith wrote:If one cant build on dunes, how does one cap mexes in sand?
Units that extract metal are allowed:

Code: Select all

local isNotValid = {}
for uDefID, uDef in pairs(UnitDefs) do
	if (uDef.extractsMetal == 0) and (uDef.maxAcc < 0.01) then --if it's not a metal extractor and does not move, it is not valid
		if string.find(uDef.tooltip, " Mine") == nil then --if it's a mine, it is valid
			isNotValid[uDefID] = true
		end
	end
end
The code above defines the list of units that can't be built on the sand. Though it looks odd, I'm using maxAcc<0.01 as a test because nano turret is not isBuilding=true, and dragon's claw has some infintessimally small maxAcc. If there's a better way than string-searching to sort mines (the kind that blow up) out of the unit blacklist, let me know.

edit: On another note, I'm fiddling with moving invalid build commands to the nearest bit of rock, so that AIs are not totally broken. The code to find nearest rock works okay, but issuing new commands seems not to do anything. Does this need to be done with a widget instead of a gadget?

Re: Mood is a thing for

Posted: 29 Jan 2012, 11:39
by Forboding Angel
Nm, this post was made in error. Nice map!

Re: Mood is a thing for

Posted: 29 Jan 2012, 12:35
by zoggop
Map options and gadgets and questionable texturing decisions, oh my!

http://springfiles.com/downloadmain/15749
http://springfiles.com/spring/spring-ma ... loveplay-0

Image

Re: Mood is a thing for

Posted: 29 Jan 2012, 15:14
by zwzsg
Pxtl wrote:Right now zwszg is currently rummaging through his old files to find that one gif.
Do I really have to? It's seven years old!