Page 1 of 1

How to make a widget that...

Posted: 28 Feb 2010, 21:12
by Kerr
I'm making a space mod, half for fun (play) and hlaf to learn how to mod spring.

Well, after asking around for several days in the chat the way to make air units unable to land (as used in CA) has a glitch with fixed wing aircraft type movement.

once out of the factory they fly in a straight line forever, right off the map if they aren't given an order.

I just need to know how to make a gadget that checks these units for orders shortly after they are built and if they have none then tell them to move to their current location (or guard, i don't care)

Help would be appreciated

Re: How to make a widget that...

Posted: 28 Feb 2010, 22:35
by SeanHeron
I'm not about to write the gadget for you, but within the Callin "Gadget:UnitFromFactory() (which returns following values --> "unitID, unitDefID, unitTeam, factID, factDefID, userOrders" ) is probably a good place to place your checks/order giving. (Other Callins here).

Then you'll need to call the appropriate SyncedRead function (using the unitID you got above) for it's position, and use that to give a move order (via the correct SyncedCtrl function).

If all that is still more or less jarble to you, I'd suggest you either look for someone to simply code the thing for you (or request so here explisitly), or grab the Spring-Lua-Guide (aka "lua bible").

Re: How to make a widget that...

Posted: 28 Feb 2010, 22:52
by SanadaUjiosan
I've found it's easiest to start small and easy, and slowly build on your knowledge. My example is right off the bat the idea of animating my models seemed overwhelming and impossible. And then one night it suddenly hit me, after staring at the simple weapon animation scripts, and I was then able to make my mechs move their arms. A week later, walking came. It's a process.

That being said, I have no idea how to do what you're wanting. Best of luck though.

Re: How to make a widget that...

Posted: 02 Mar 2010, 04:30
by FLOZi
SWIW apparantly had the bug where aircraft just fly straight off the map too, gnomre said i should ask Zsinj

Re: How to make a widget that...

Posted: 05 Mar 2010, 04:54
by Kerr
well, I still haven't found a fix for this.

For now i'll just have to let my fighters land... and te gunships aren't bugged with this.

Re: How to make a widget that...

Posted: 05 Mar 2010, 07:10
by Saktoth
You're using the special air flight dynamics tags? maxrudder, aileron, etc?

Yeah those are whacky.

Re: How to make a widget that...

Posted: 05 Mar 2010, 14:59
by FLOZi
Saktoth wrote:You're using the special air flight dynamics tags? maxrudder, aileron, etc?

Yeah those are whacky.
No, he isn't.

Re: How to make a widget that...

Posted: 26 Mar 2010, 18:14
by Kerr
I Stopped looking lol.

No I'm not.

Here one min i'll post my code...

err

http://darkstars.co.uk/svn/kerr

EDIT:

Emphasis on i just started modding spring!
(don't comment on cosmetics >_<)
:shock:

basically, to repeat this bug, build 1 Frintas (light Scout) at the Command Portal, and watch and wait.

oooh! flies right off the map!

Re: How to make a widget that...

Posted: 26 Mar 2010, 18:25
by JohannesH
Its possible to make planes fly off map in any game... Spring planes are just retarded to micro :/
But just give the airfactory a waypoint automatically, shouldnt that fix the problem?

Re: How to make a widget that...

Posted: 26 Mar 2010, 22:01
by Kerr
That was what this was about.

But I got FLOZi to help me out on that, it's rather a bit rickety fix and I removed it.

(gave the fighters a waypoint upon creation if no orders, however, they wouldn't follow rally points by the factory Because for some reason it's not given before the unit finishes building...)

also you had to have a huge offset of position or it would fill the move order before it finishes factory flyout.

This had inherient problems with building placement, if it is near the edge of the map then it won't work. (same for the nano patrol roam widgets; Try DSD East and place nanos on the very edge, they'll not be given the order)

so...