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?
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
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?!
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.
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:
at the top of the swallow function, which is called by:
Code:
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.
AttachUnit will only work if the unit calling it has the transportCapacity tag
Quote:
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.
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?
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
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.
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.
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.
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
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.
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum