Mood is a thing for - Page 7

Mood is a thing for

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop » 21 Mar 2015, 22:53

Updating this thing to work in 98, and thought i'd try to make the worm eating animation actually grab the unit and bring it down. Spring.UnitScript.AttachUnit is working, but the attached unit disappears once it's attached. I can still select the attached unit, and see its selection box (so I can see that it's moving the way it ought to), but there's no unit rendered. Anyone have an idea why this might be?

here's the worm's unit script

Code: Select all

return {
	sworm = {
		blocking = false,
		buildPic = "sworm.png",
		canMove = true,
		description = "Giant hungry beast.",
		footprintX = 6,
		footprintZ = 6,
		holdSteady = true,
		iconType = "sworm",
		isFirePlatform = true,
		isTransport = true,
		levelGround = false,
		loadingRadius = 256,
		maxDamage = 9999,
		name = "Sand Worm",
		objectName = "swormOpenMouth-180_50out-r45.s3o",
		script = [[sWormOpenMouth.lua]],
		stealth = true,
		transmaxunits = [[10]],
		transportCapacity = 1000,
  		transportMass = 500000,
 		transportSize = 100000,
		customParams = {
 			ignoreplacementrestriction = true,
		},
	},
}
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6108
Joined: 29 Apr 2005, 01:14

Re: Mood is a thing for

Post by FLOZi » 21 Mar 2015, 23:20

That's the unitdef, please post script (do you attach to '-1' piece?)
0 x

User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop » 21 Mar 2015, 23:41

https://github.com/zoggop/cattle-and-lo ... nMouth.lua

did a quick echo, the piece ("foodmagnet") is 10
0 x

User avatar
Jools
XTA Developer
Posts: 2804
Joined: 23 Feb 2009, 16:29

Re: Mood is a thing for

Post by Jools » 22 Mar 2015, 01:48

We have sandworms in Spring? Cool. Very cool!
0 x

8611
XTA Developer
Posts: 242
Joined: 29 Dec 2014, 08:22

Re: Mood is a thing for

Post by 8611 » 22 Mar 2015, 14:51

The Spring.UnitScript.AttachUnit things still works in 98, so seems to be something with that script/model/mod.
There was too much other error spam to test the map.
The sync/unsynced seperation got changed a bit and requires "stricter" use of if gadgetHandler:IsSyncedCode() then ... else...
I assume you know what else to fix etc. ;)


Try to attach the unit but do not move the piece around. Then move piece around but only above ground, then try underground,...
Press alt+v or type /DebugColVol to see units hitbox, maybe more detailed than looking at selectionbox.
With /wiremap you can track what units do under the terrain..

If the attached unit can still be selected that already means it is not attached to piecenumber -1 because "in this state it will never be be selectable"
https://github.com/spring/spring/blob/d ... g.txt#L525

Unrelated, do not pack as solid archives.
0 x

User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop » 22 Mar 2015, 17:49

thank you so much for taking a look!
8611 wrote:There was too much other error spam to test the map.
The sync/unsynced seperation got changed a bit and requires "stricter" use of if gadgetHandler:IsSyncedCode() then ... else...
ya, loading up the map for the first time in a while and getting all this error spam is what made me realize i need to update it. i've resolved all the sync/unsync problems in the version on github.
Press alt+v or type /DebugColVol
ooo, v. helpful
0 x

User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop » 23 Mar 2015, 05:42

okay, now all the worm unit script does is:

Code: Select all

function script.Create()
local x,y,z = Spring.GetUnitPosition (unitID)
if (x and y and z) then
	local nearunits=Spring.GetUnitsInSphere  (x,y,z, 32) or "nothing"
	if (nearunits~="nothing") then		
		for _, nearunitid in ipairs (nearunits) do
			if (nearunitid~=unitID) then
				-- SwallowTest(nearunitid)
				AttachUnit(foodmagnet, nearunitid)
				Sleep(3000)
				DropUnit(nearunitid)
				break
			end
		end
	end
end
end
(where AttachUnit = Spring.UnitScript.AttachUnit, and DropUnit = Spring.UnitScript.DropUnit)

result? worm appears. nearby unit disappears for three seconds. nearby unit reappears and drops to the ground.
Attachments
armpw_dropped.png
armpw_dropped.png (133.23 KiB) Viewed 1424 times
armpw_attached.png
armpw_attached.png (131.5 KiB) Viewed 1424 times
0 x

User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop » 23 Mar 2015, 06:00

okay, the whole problem was

Code: Select all

holdSteady = true,
in the unit def
0 x


8611
XTA Developer
Posts: 242
Joined: 29 Dec 2014, 08:22

Re: Mood is a thing for

Post by 8611 » 23 Mar 2015, 07:25

It it eating an energy storage? (try with a mobile unit?)

holdSteady=true/false should just change how passenger's orientation behaves...
From those pictures I see no reason why passenger should be invisible. Engine bug?
Here holdSteady does things with vectors:
https://github.com/spring/spring/blob/d ... it.cpp#L67
Drawing problems in https://springrts.com/mantis/view.php?id=2376 & https://springrts.com/mantis/view.php?id=2222 were related to vector things too, maybe it is similiar...?
0 x

User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop » 23 Mar 2015, 11:32

8611 wrote:It it eating an energy storage? (try with a mobile unit?)
ah, no that's a peewee, its colvol is just a cylinder apparently.
8611 wrote:holdSteady=true/false should just change how passenger's orientation behaves...
From those pictures I see no reason why passenger should be invisible
agreed. i would say it's this particular piece's fault, b/c it's tiny & not visible itself, but i tried attaching to other pieces too with same result.
8611 wrote:Engine bug?
I guess the question is, are there any examples of using holdSteady successfully?
0 x

User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Mood is a thing for

Post by qray » 24 Mar 2015, 21:09

Thanks for updating, it's great to have the worms back! :-)

Always liked this map (looks great, and the different play due to worms is a cool variety of game play).
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6108
Joined: 29 Apr 2005, 01:14

Re: Mood is a thing for

Post by FLOZi » 25 Mar 2015, 18:07

zoggop wrote: I guess the question is, are there any examples of using holdSteady successfully?
MCL uses holdsteady on the dropships which deploy upgrades, was working last I checked (but that was some time ago)
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14589
Joined: 17 Nov 2005, 02:43

Re: Mood is a thing for

Post by Forboding Angel » 03 Jun 2015, 08:22

Sandworms confirmed.

https://youtu.be/i0YkVp-Kv_k
0 x

Post Reply

Return to “Map Creation”