Mood is a thing for - Page 5

Mood is a thing for

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

Moderator: Moderators

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10238
Joined: 24 Jan 2006, 21:12

Re: Mood is a thing for

Post by PicassoCT » 22 Feb 2012, 00:54

yep, 29 years long... surely, if you give me another year, i can get all grown up and serious buisnessmeni


ZogOP, would you be okay, if i ported your sandworm afterwards to Behes Melange? The Spice must flow, no matter if there are worms in it..
0 x

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

Re: Mood is a thing for

Post by zoggop » 22 Feb 2012, 02:54

PicassoCT wrote:ZogOP, would you be okay, if i ported your sandworm afterwards to Behes Melange? The Spice must flow, no matter if there are worms in it..
I'm all for the flow. How can I call your swallow function with my gadget? (so continues moment of slippage) But really though, should I just put swallow in a TransportPickup callin, or is it possible to explicitly call script functions from within a gadget?

edit: i'm an idiot, i need to fix the unitdef
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10238
Joined: 24 Jan 2006, 21:12

Re: Mood is a thing for

Post by PicassoCT » 22 Feb 2012, 20:27

Are we there, dad?

No, wait, that doesent fit the situation.
IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!
........................................................................................................................IS IT DONE YET, ZOGGOP?!IS IT
........................................................................................................................DONE YET, ZOGGOP?!IS IT DONE YET,
........................................................................................................................ZOGGOP?!IS IT DONE YET,
........................................................................................................................ZOGGOP?!IS IT DONE YET,
........................................................................................................................ZOGGOP?!IS IT DONE YET,
........................................................................................................................ ZOGGOP?!IS IT DONE YET,
........................................................................................................................ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!
IS IT DONE YET, ZOGGOP?!IS IT DONE
YET, ZOGGOP?!IS IT DONE YET,
ZOGGOP?!IS IT DONE YET, ZOGGOP?!
IS IT DONE YET, ZOGGOP?!IS IT DONE
YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!
IS IT DONE YET, ZOGGOP?!IS IT DONE
YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!
IS IT DONE YET, ZOGGOP?!IS IT DONE
YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?! IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!IS IT DONE YET, ZOGGOP?!


....................................................................... IS IT DONE YET, ZOGGOP?!
.......................................................................IS IT DONE YET, ZOGGOP?!
....................................................................... IS IT DONE YET, ZOGGOP?!
0 x

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

Re: Mood is a thing for

Post by zoggop » 22 Feb 2012, 23:45

No. Waiting is good for you. It builds character.

The unit script doesn't seem to be getting used (and I should hope it likes to get used).

Code: Select all

[f=0000000] Loading gadget: Lua unit script framework  <unit_script.lua>
[f=0000000]   Loading unit script: scripts/emergesworm.lua
^ this happens, yet every time I create a unit:

Code: Select all

[f=0003600] Warning: Could not load COB script for unit "emergesworm" from: scripts/emergesworm.cob
Why is Spring looking for the COB script at all, if it found the lua script?

(emergesworm is your unit renamed, which I did for a reason, but I forgot)
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10238
Joined: 24 Jan 2006, 21:12

Re: Mood is a thing for

Post by PicassoCT » 22 Feb 2012, 23:59

did you tell it in the unitdef to look for the script?
something like

script= NameItlikeyouwant.lua,
0 x

User avatar
smoth
Posts: 22298
Joined: 13 Jan 2005, 00:46

Re: Mood is a thing for

Post by smoth » 23 Feb 2012, 00:22

you have to specify .lua for lua unit scripts..

so script = wagarble.lua
0 x

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

Re: Mood is a thing for

Post by zoggop » 23 Feb 2012, 06:16

IS IT DONE YET, ZOGGOP?!
Not really, but it like, does something now, and stuff. It has a 50% chance (plus 1% for every unit on the sand) to randomly eat a unit on the sand, and does so. Since you're practically jumping up and down, here's what I have so far, which is kind of lame, and causes segfaults with some AIs. I'm guessing I'll have something cooler with wormsign etc in about a week, following my omg-new-thing/who-gives-a-fuck/sucked-back-in cycle.
Attachments
cal-sworm_testing.zip
(511.78 KiB) Downloaded 19 times
0 x

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

Re: Mood is a thing for

Post by zoggop » 26 Feb 2012, 21:15

The worm movement lua all works, and I made a worm sign lightning effect. I'd show screenshots, but, it's lightning, so I can't really time a screenshot right. What still doesn't work is AttachUnit. I've tried putting this immediately after creating Picasso's swallowing worm unit:

Code: Select all

Spring.UnitScript.CallAsUnit(attackerID, Spring.UnitScript.AttachUnit, 10, targetID)
(worm is attackerID)
I've also tried putting the AttachUnit call in the unit script:

Code: Select all

Spring.UnitScript.AttachUnit(foodmagnet, idUnitToBeSwallowed)
at the top of the swallow function, which is called by:

Code: Select all

function script.Create()

--move the worm into the position underground
Move(center,y_axis,-230,0) --Moves the worm underground Instantanously
Spin(center,y_axis,0.02,1) -- worm rotates slowly

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
				swallow(nearunitid)
				break
			end
		end
	end
end

end
(interestingly, simply calling AttachUnit rather than Spring.UnitScript.AttachUnit in the script results in an attempt to call a nil global error)

Both methods don't attach anything. The unit being swallowed runs away, and then disappears when swallow() destroys it.

Any suggestions?
0 x

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

Re: Mood is a thing for

Post by FLOZi » 26 Feb 2012, 22:18

AttachUnit will only work if the unit calling it has the transportCapacity tag
simply calling AttachUnit rather than Spring.UnitScript.AttachUnit in the script results in an attempt to call a nil global error
This is because AttachUnit is not localised in the default unit script header ( https://github.com/spring/spring/blob/m ... header.lua ), due to it not being used in most scripts and there being a limited number of locals in a lua script, iirc.
0 x

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

Re: Mood is a thing for

Post by zoggop » 26 Feb 2012, 23:07

FLOZi wrote:AttachUnit will only work if the unit calling it has the transportCapacity tag
from the worm's unitdefs:

Code: Select all

isTransport = true,
loadingRadius = 512,
transportCapacity = 10,
transportMass = 50000,
transportSize = 10000,
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10238
Joined: 24 Jan 2006, 21:12

Re: Mood is a thing for

Post by PicassoCT » 27 Feb 2012, 00:42

Well.. the runaway is easily fixxed.. by setting the units acceleration to zero.

http://code.google.com/p/zero-k/source/ ... arch+Trunk

unit that loads another unit..
0 x

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

Re: Mood is a thing for

Post by zoggop » 27 Feb 2012, 07:39

have been fiddling with the unitdef per zK's armtboat. still can't get it to attach to anything. is there some kind of uberverbose engine mode that would tell me something helpful like "AttachUnit() not allowed because ____"? or is that pie in the sky?
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10238
Joined: 24 Jan 2006, 21:12

Re: Mood is a thing for

Post by PicassoCT » 27 Feb 2012, 11:07

lets handle this systematic, like a doctor cutting of slices of patient until the guy can be delcared healthy.

Obviously the unitdef. Some of those keywords trigger magic chainreactions, leading to other keywords beeing ignored. If you say its a boat, maxfleightheight will be ignored. So coment everything in there out, that isnt absolutly needed.

Next post infolog.
0 x

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

Re: Mood is a thing for

Post by zoggop » 27 Feb 2012, 21:37

good idea
let the culling begin
0 x

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

Re: Mood is a thing for

Post by zoggop » 27 Feb 2012, 22:19

whole damned unitdef:

Code: Select all

return {
	sworm = {
		blocking = false,
		canmove = true,
		description = "Giant hungry beast.",
		footprintx = 6,
		footprintz = 6,
--		holdSteady = true,
		isFirePlatform = true,
--		isTransport = true,
		levelGround = false,
--		loadingRadius = 256,
		maxdamage = 9999,
		name = "Sand Worm",
		objectname = "sWorm.s3o",
		script = [[sWorm.lua]],
--		transmaxunits = [[10]],
		transportCapacity = 100,
  		transportMass = 50000,
-- 		transportSize = 10000,
		customParams = {
 			ignoreplacementrestriction = true,
		},
	},
}
will not attach. waiting for the other doctor to come take the paddles out of my hands and tell me that his pulse stopped ten minutes ago.

edit: here is infolog, but it's not terribly helpful, and mostly full of debug info from the sand worm gadget.
0 x

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

Re: Mood is a thing for

Post by FLOZi » 27 Feb 2012, 23:22

This is for a map right? What game are you testing? There are some limits to prevent loading enemy units, though I would have thought directly AttachUnit'ing the id should work.
0 x

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

Re: Mood is a thing for

Post by zoggop » 28 Feb 2012, 00:32

Right, the prevention of loading enemy units is why I'm not making the worm actually a transport and giving it load unit commands. I thought the AttachUnit thing would work because it worked for knorke's magnetic BA, which is what I used to tell me what unitdef parameters to use (magnetic BA has a thing that posts to the unitdefs before the game somehow), and how to attach units. The game I'm testing is BA 7.63.

edit: wait, the magnetic thing was only done on friendly units. maybe the no enemy unit loading test is done at an AttachUnit level? But I guess I thought in BA most units are nappable anyway. Well, to continue thinking out loud, I'll make the worms spawn on the same team as the unit they're eating, see what happens.
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

Re: Mood is a thing for

Post by Beherith » 28 Feb 2012, 00:46

Ill gladly add an exception to no load enemy units to gaia units if you need me to.
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10238
Joined: 24 Jan 2006, 21:12

Re: Mood is a thing for

Post by PicassoCT » 28 Feb 2012, 00:56

zoggop wrote:Right, the prevention of loading enemy units is why I'm not making the worm actually a transport and giving it load unit commands. I thought the AttachUnit thing would work because it worked for knorke's magnetic BA, which is what I used to tell me what unitdef parameters to use (magnetic BA has a thing that posts to the unitdefs before the game somehow), and how to attach units. The game I'm testing is BA 7.63.

edit: wait, the magnetic thing was only done on friendly units. maybe the no enemy unit loading test is done at an AttachUnit level? But I guess I thought in BA most units are nappable anyway. Well, to continue thinking out loud, I'll make the worms spawn on the same team as the unit they're eating, see what happens.
knorkes magnetic mod loaded enemys and friendlys.. resulting in funny towerdefense infights.. and a full wormstomage is a full wormstomage.. shall god sort out his own..


Spring.UnitScript.AttachUnit ( piece, passengerID )
should work with transport.
0 x

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

Re: Mood is a thing for

Post by zoggop » 28 Feb 2012, 08:13

Beherith wrote:Ill gladly add an exception to no load enemy units to gaia units if you need me to.
Thanks, but it seems that the unit's team wasn't the problem.
Spring.UnitScript.AttachUnit ( piece, passengerID )
should work with transport.
I agree, but um...
0 x

Post Reply

Return to “Map Creation”