New widget: OnlyFightersPatrol

New widget: OnlyFightersPatrol

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

Moderator: Moderators

Post Reply
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

New widget: OnlyFightersPatrol

Post by dizekat »

Widget:
http://dmytry.no-ip.org/unit_only_fighters_patrol.lua
Description:
Only fighters go on air factory's patrol route after leaving factory. Improves fps in late game.

What does it do:
When you're spamming fighters, bombers, radar/sonar planes, and so on with factory set on repeat, and with factory command queue to patrol your airspace, only fighters will go on patrol route, other airplanes(except builders) are stopped.
Scout and radar/sonar planes on patrol are extremely CPU intensive (about 10x more than fighters, for me), so it does improve fps quite a bit.

Widget doesn't do anything when queue does not contain "patrol". (also it detects patrol even if it is not first command in queue)

Builders (construction airplanes):
Widget does not modify command queue of builders, for compatibility with FactoryGuard and similar widgets which send builders to do something. If you want it to stop builders too, change stop_builders=false to stop_builders=true

In some mods it could have problems with "fighters" which are actually dive bombers. You can edit script and add names of fighters which you don't want to go on patrol (same as done for "Liche")

I have idea for more advanced widget that would let you set different command queues for different kinds of units at factory.
User avatar
Tribulexrenamed
Posts: 775
Joined: 22 Apr 2008, 19:06

Re: New widget: OnlyFightersPatrol

Post by Tribulexrenamed »

Mate, would you mind if i made a few modifications to yor script?
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: New widget: OnlyFightersPatrol

Post by dizekat »

no, ofc i wouldnt mind... its meant to be customized by people for their needs... e.g. if someone wants his gunships to go on patrol aswell, its trivial change. (however, gunships (t2 and t1 alike) on patrol arent useful IMO, 1..2 flaks getting under patrol route can kill them one by one... you always have to micro gunships anyway to kill ground AA first) But unless you enjoy very low fps games, dont release widget that sets both radars and fighters on patrol
User avatar
Tribulexrenamed
Posts: 775
Joined: 22 Apr 2008, 19:06

Re: New widget: OnlyFightersPatrol

Post by Tribulexrenamed »

Just making sure. :wink:

However, on second thought, I want to start from scratch. What I want to do is set up a custom patrol route with draggable waypoints on the map. I dont know how exactly this would work with GUIs etc, but I think its worth it to figure it out. Then, all fighters from all factories would be given those patrol orders, and other orders from the factories would be followed by all other units. Does this make sense?
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: New widget: OnlyFightersPatrol

Post by dizekat »

Well i thought about making different factory command queues for different unit types. The problem is user interface, how user would select for which unit the route is made. Needs some modification to the BALayout script, or which script handles unit icons. Maybe something+click on build icon, then make queue as usual.
Paths with draggable waypoints are good idea, "outlive" RTS (old style starcraft-ish RTS) has it. You can make path, then send units to it.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: New widget: OnlyFightersPatrol

Post by Beherith »

Superb. Love the widget. But it still makes my arm t2 radar planes patrol.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: New widget: OnlyFightersPatrol

Post by aegis »

Tribulex wrote:Just making sure. :wink:

What I want to do is set up a custom patrol route with draggable waypoints on the map.
There is already a waypoint dragging widget.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: New widget: OnlyFightersPatrol

Post by LordMatt »

It was made by Ray. IIRC it had some bugs and doesn't work with current spring version.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: New widget: OnlyFightersPatrol

Post by Kloot »

Mine still does.
User avatar
Tribulexrenamed
Posts: 775
Joined: 22 Apr 2008, 19:06

Re: New widget: OnlyFightersPatrol

Post by Tribulexrenamed »

I know there is a draggable waypoints widget. I have it and its mostly useless in my opinion. Custom commands for each unit was actually an idea of a friend of mine, and it is one of the goals of the gui project that I have taken on. Also, the ba layout is just a layout, and its not where changes should be made. I am using Iceui, which has an excellent framework that supports different click actions with modifiers. After the tooltip is done, we will recreate the control panel using Iceui, and then work from that point. This is the point at which this project becomes more than graphical enhancement.
Beherith wrote:Superb. Love the widget. But it still makes my arm t2 radar planes patrol.
Modify the script in the same way that dizekat has done for the Liche.
CautionToTheWind
Posts: 272
Joined: 30 May 2006, 17:06

Re: New widget: OnlyFightersPatrol

Post by CautionToTheWind »

The link doesn't work. Are you hosting this on your computer? Turn it on, please :)
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: New widget: OnlyFightersPatrol

Post by ginekolog »

link is dead.. next time its better to post on jobol site
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: New widget: OnlyFightersPatrol

Post by dizekat »

Sorry for non-availability.

Uploaded to stable site:
http://dmytry.pandromeda.com/tmp/lua_fo ... patrol.lua
Post Reply

Return to “Lua Scripts”