Various questions relayed to new zoy shooter

Various questions relayed to new zoy shooter

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderators: Moderators, Moderators

Post Reply
User avatar
smoke_th
Posts: 140
Joined: 25 May 2010, 13:15

Various questions relayed to new zoy shooter

Post by smoke_th »

*sigh* i'm stucked again :? . Ok here 2 questions.
1. How can i get from map amount of embedded start positions and their coordinates?
2. Strafe system question - how? o_O i'm really stucked here not only i'm lazy but also i cannot figure out how to make regular forces (not gunships) strafe. I found in fbi files this undocumented option mobilestandorders=1 for brawler but i really dunno, what is it. Mabye HoverAttack=1 will be switch on strafing...i dunno too. I know this is not lua question but i do not want place loads of junk posts on forum.
0 x

User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Various questions relayed to new zoy shooter

Post by Pxtl »

Land units can't strafe automatically - the engine does not provide this feature. However, it can be implemented using Lua. Look up the AutoSkirmish and AutoSwamr widget sin the SpringDownloader widget system.
0 x

User avatar
smoke_th
Posts: 140
Joined: 25 May 2010, 13:15

Re: Various questions relayed to new zoy shooter

Post by smoke_th »

Pxtl wrote:Land units can't strafe automatically - the engine does not provide this feature. However, it can be implemented using Lua. Look up the AutoSkirmish and AutoSwamr widget sin the SpringDownloader widget system.
I don't need strafe em automatically - i need that when i'm in fps control mode by pressing left or right button unit will strafe to left or right - not rotate his tracks/pelvis
0 x

User avatar
FireStorm_
Posts: 665
Joined: 19 Aug 2009, 16:09

Re: Various questions relayed to new zoy shooter

Post by FireStorm_ »

Don't know if i'm helping or stating the obvious, but perhaps somehow bind acceleration and an instant 90 degrees rotation of the pelvis to the D key (assuming WSAD for movement), and -90 degrees to the A key...
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Various questions relayed to new zoy shooter

Post by knorke »

Pxtl wrote:Land units can't strafe automatically - the engine does not provide this feature. However, it can be implemented using Lua. Look up the AutoSkirmish and AutoSwamr widget sin the SpringDownloader widget system.
do these widgets make the units strafe as in side stepping? I thought they just keep units at max range or make them run in circles.

Ah I think he really wants strafing as in side stepping not "doing strafing runs." I think only gunships can move sideways in spring.
But Lua can help maybe:
http://springrts.com/wiki/Lua_SyncedCtrl#Unit_Control
With Spring.SetUnitPosition and Spring.SetUnitRotation you could probally make units move the way you want.

See this thread: http://springrts.com/phpbb/viewtopic.php?f=14&t=22887 for lua used to control the movement of falling meteors

Oh and that "Airraid" game might be worth looking at too. (third person flight game in spring)
0 x

User avatar
smoke_th
Posts: 140
Joined: 25 May 2010, 13:15

Re: Various questions relayed to new zoy shooter

Post by smoke_th »

:evil: damn. Lua this lua that, i understand this will work but this will be looks like as shit. With no ani, and no other features. Why only gunships can? What so specific in them? Where this wrote? What flag i can use for it?
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7017
Joined: 16 Nov 2004, 13:08

Re: Various questions relayed to new zoy shooter

Post by zwzsg »

Move control would feel very artificial: No collision check, no terrain check, etc...

I still think the best way would be to tell it to move sideway with turret straight (or rather, counter-turned). Make the unit have a very high turning rate, so turning is instant. Make pressing left strafe or right strafe tell the unit to move left or right, with turret turned +/-90┬░. Of course, if the unit is under direct control, move order might be ignored, and that'd be an issue. I'm also not sure you can turn the camera 90┬░ if it's in direct control mode. I am supposing your mod still use the hard coded "C" direct control mode. I would instead switch to a system like in my HOMF, where the engine think not a unit is controlled, not a unit is selected, but a gadget translate keypresses into move order (technically, SetUnitMoveGoal). Have you tried HOMF yet? There strafing is not a problem: you move in any of the eight direction with the four arrow key, while aiming freely 360┬░ with the mouse. Yes, my HOMF is using a top down view instead of a first person view. But that is just a matter of rewriting the SetCameraState line. You will also want to change a bit the keys->SetUnitMoveGoal conversion so that's it's relative to the direction camera is pointing instead of map's absolute N-S-E-W. As an extra, maybe change what it does with mouse pointer from "point to world coordinate pointed by mouse" to some "turn accordingly to mouse screen coordinate", but that might not even be necessary, or simply use middle-click mode.

- Unlike move control, in my HOMF system the unit is still subject to the game's physic.
- Unlike hard coded direct control, in my HOMF system you have full freedom to lua whatever behavior you want.

I heard Regret implemented some sort of virtual unit. See his topic SpecRun - Your own imaginary unit. Use it to convert user controls to FPS movements. Then bind it to a physical unit, with code from my shoot_n_run.lua gadget. And you'll have far better FPS control than the hard coded "C" direct control. Yes, you do need to know Lua to glue my code to Regret's code, then polish at the corner. But, those two Lua codes show good FPS control is possible in Spring without engine changes. Multiplayer would still suffer from the unresponsivness from Spring networking model, but quit Spring and go use a true FPS engine if you need position prediction and smooth handling of lag.

In short: Pretty much implemented in other projects, but you need to learn Lua to bring it together.
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Various questions relayed to new zoy shooter

Post by knorke »

zwzsg uses google bombing.
its supereffective.
0 x

Post Reply

Return to “Lua Scripts”

cron