Widget request: Automatically paralyse and capture

Widget request: Automatically paralyse and capture

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

Moderator: Moderators

klapmongool
Posts: 843
Joined: 13 Aug 2007, 13:19

Widget request: Automatically paralyse and capture

Post by klapmongool »

I need a widget for a specific unit: the capture bot in Tech Annihilation.

The unit has a weapon that paralyses and it has a capture ability. The unit does not automatically fire.

I think it should be possible to let a widget control the unit in such a way that it:

a) automatically fires upon enemy units within range (easiest? and would be great improvement)

b) automatically identifies paralysed units in range to switch to capturing it (probably harder but handy)

Senna (mod owner) told me that this is not possible. I disagree, even though I know shit about it.

Any ideas on how to go about this?
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Widget request: Automatically paralyse and capture

Post by Pxtl »

Honestly, capture-as-power has always been a bad idea unless you have a good reason not to use the capture-power. Senna should fix the unit so that its weapon deals a small amount of capture damage on top of its stun damage, so that after stunning the target 8x over or so the unit would capture automatically. This would avoid the tedious microing of manual capture.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Widget request: Automatically paralyse and capture

Post by Forboding Angel »

There is such a thing as capture damage?
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Widget request: Automatically paralyse and capture

Post by Pxtl »

Forboding Angel wrote:There is such a thing as capture damage?
Yup. iirc it's only dealable through Spring.SetUnitHealth Lua function... although I suddenly realized that I have no idea what happens when you set it to zero, since it's done through SetUnitHealth instead of Spring.AddUnitDamage - you might have to manually call Spring.TransferUnit.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Widget request: Automatically paralyse and capture

Post by Forboding Angel »

Ahhh ok, I saw the luactrl for it; I thought you were saying that there was a weapon variable for it (which would be fricking sweet).
klapmongool
Posts: 843
Joined: 13 Aug 2007, 13:19

Re: Widget request: Automatically paralyse and capture

Post by klapmongool »

Well, I wouldnt mind manually capturing as long as the units would at least paralyse automatically. The thing is.. Senna does not want to change that aspect of the unit out of fear that it will be overpowered. Hence the widget request.

Any idea if that part is possible?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Widget request: Automatically paralyse and capture

Post by knorke »

dont see why it shouldnt be possible. not sure if cheat lolz.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Widget request: Automatically paralyse and capture

Post by AF »

Capture as power works. It just doesnt work when its manual fire, look at supcom 2 and the loyalty gun.
klapmongool
Posts: 843
Joined: 13 Aug 2007, 13:19

Re: Widget request: Automatically paralyse and capture

Post by klapmongool »

AF wrote:Capture as power works. It just doesnt work when its manual fire, look at supcom 2 and the loyalty gun.
Hence my request :D

Knorke: isnt the rule that if you could in theory do it by hand it isnt considered cheating? Like metal maker widgets or immobiles or .. almost any widget.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Widget request: Automatically paralyse and capture

Post by AF »

Given a targeting radius X, most likely to be the los or capture range with a little extra tacked on:

Code: Select all

on unit idle
    if unit is a capture bot
        unitsnearby = Get all units within radius X
        closestunit = nil
        closestdistance = very very big number
        foreach targetunit in unitsnearby
            position = get targetunits position
            distance = distance between capture bot and targetunit
            if distance < closestdistance then
                closestunit = targetunit
                closestdistance = distance
            endif
        endforeach
        if closest != nil then
            tell unit to capture closestunit
        endif
    endif
end on unit idle
Should do the trick, although theres a massive number of ways to improve that code and make it run faster. ( note its not lua code its pseudocode for those trying to copy paste)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Widget request: Automatically paralyse and capture

Post by knorke »

isnt the rule that if you could in theory do it by hand it isnt considered cheating? Like metal maker widgets or immobiles or .. almost any widget.
yea true, but if its senna's mod and he does not want it to be played like this, i think it should be respected. inb4 hurr durr he could put something in to prevent this but imo that just is useless work for the game maker and also useless for the widget maker because it wont work afterwards.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Widget request: Automatically paralyse and capture

Post by smoth »

klapmongool wrote:Knorke: isnt the rule that if you could in theory do it by hand it isnt considered cheating? Like metal maker widgets or immobiles or .. almost any widget.

Image
Say you wanted to make a sweater for someone you love.

you could learn to knit, make sweater.

you could teach machine to knit make sweater.

which sweater has your feelings in it?
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Widget request: Automatically paralyse and capture

Post by SinbadEV »

smoth wrote:
klapmongool wrote:Knorke: isnt the rule that if you could in theory do it by hand it isnt considered cheating? Like metal maker widgets or immobiles or .. almost any widget.

Image
Say you wanted to make a sweater for someone you love.

you could learn to knit, make sweater.

you could teach machine to knit make sweater.

which sweater has your feelings in it?
Ah... but the machine made sweater could put out 100 sweaters with the same amount of effort on your part as the 1 hand knit sweater and could be sold to tourists in the giftshop at a pioneer village and people would just assume it was a hand knit sweater and you would end up with a lot more money which you could use to pay other people to run the machine for and spend more time with your loved ones which is a much better gift then a hand knit sweater.

Also... was there any chance that this thread was NOT going to get derailed?

Also, Also... we forgot to mention that if you want a widget you can always code it yourself... which is, in a funny way, sort of related to what smoth said... I can't be sure that that wasn't what he meant in the first place.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Widget request: Automatically paralyse and capture

Post by knorke »

you are missing the point. he made it that way for a reason:
Senna does not want to change that aspect of the unit out of fear that it will be overpowered
so its more like being lame and bringing a machine to a friendly knitting competetion of old grannys who all knit by hand.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Widget request: Automatically paralyse and capture

Post by smoth »

Writing the software for said machine merely makes you a peon, if you had the capitol to start a sweater factory you would already have the time to spend with the family you would have employees writing your sweater software. Oh and even if you have the capitol, you need connections and know how in the textile industry. You cannot pretend writing the sweater program is worth any value as they already had sweater robots. You are replaceable. Your analogy is tragically flawed.

A hand made sweater is unique.
When worn evokes memories and feelings.
You do it in the spare time when the person is not around, your feeling go into it and it is a surprise this way.


The important part is the game is about you, what you can do as a player, too much automation and it becomes about who had a computer that was more powerful and thus run a deeper automation algo.

as far as a widget automatically paralyzing and capturing. This cannot be done. Those values have to be set via a gadget. Sure you could write a widget to tell it to give attack orders to fire it's paralyze capture thing at nearby enemies but you violate the spirit of the game. The reason why players jack off over apm is because of the amount of actions they made.
klapmongool
Posts: 843
Joined: 13 Aug 2007, 13:19

Re: Widget request: Automatically paralyse and capture

Post by klapmongool »

Well, to all above: I do love the attention you guys are giving this topic.

@knorke: Sure, but it is a silly limitation to the unit. If he does not want the unit to be overpowered he could just lower the unit's buildpower (its at 2000 now) or its paralyse dmg (not sure what it is, pretty high and AoE).

@smoth1: *del* Lovely analogy, love the work you guys do.

@smoth2: there are dozens of widgets that reduce the need for players to have apm.

@smoth3: I do not wanna knit my enemies a nice sweater filled with love. I want to use a unit that could be loads of fun but is being hindered by a silly rule (not automatically using its weapon on nmys).

@sinbad (just cos you cared): Yes, I totally agree. It is way better to feed the widget machine with good ideas than to create a widget machine myself. Also, making this thread I was kinda aiming for an open ending. Derailing was part of the plan, ty for making that happen. Smoth was annoyingly on topic, as you noticed.


Oh, ninja edit:
Smoth, ino no one is supposed to ask you this... but iv been looking forward to that tower defense mod since you started it... any chance its any time soon?
Last edited by klapmongool on 25 Jan 2011, 00:00, edited 1 time in total.
luckywaldo7
Posts: 1398
Joined: 17 Sep 2008, 04:36

Re: Widget request: Automatically paralyse and capture

Post by luckywaldo7 »

klapmongool wrote:Derailing was part of the plan, ty for making that happen.
:D
Ah, well if you insist...

If you consider that the human body is really just a biological machine, a hand-made sweater would also be a machine-made sweater.

Or, you could consider that, by writing the program, you were hand-creating the sweater as a sum of information defining machine movements that then only needed to be processed through a machine, than the machine-made sweater was also hand-made.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Widget request: Automatically paralyse and capture

Post by smoth »

klapmongool wrote:Well, to all above: I do love the attention you guys are giving this topic.
no worries, lua is a slow subforum.
klapmongool wrote:@smoth1: *del* Lovely analogy, love the work you guys do.
del?
klapmongool wrote:@smoth2: there are dozens of widgets that reduce the need for players to have apm.
Such as?
klapmongool wrote:@smoth3: I do not wanna knit my enemies a nice sweater filled with love. I want to use a unit that could be loads of fun but is being hindered by a silly rule (not automatically using its weapon on nmys).
Thing is the not-auto fire status of that weapon is probably done on purpose but likely because you don't want it wasting time randomly you want it to focus on a target. Thing is if that was the case he could make it auto-hold fire on spawn. I have a gadget that does this in gundam, thing is PD.
klapmongool wrote:Oh, ninja edit:
Smoth, ino no one is supposed to ask you this... but iv been looking forward to that tower defense mod since you started it... any chance its any time soon?
Well, the short answer is quantum took over the reigns and added a bunch of cool features but the new pathfinder screwed it up for him so he stopped for a bit. I will revisit it later tonight and see if it is better again.
klapmongool
Posts: 843
Joined: 13 Aug 2007, 13:19

Re: Widget request: Automatically paralyse and capture

Post by klapmongool »

klapmongool wrote:@smoth2: there are dozens of widgets that reduce the need for players to have apm.
smoth wrote:Such as?
Uhhm, I feel like we might mean different things here... but how about these examples from my widget dir:

auto_reclaim_heal_assist.lua
gui_idle_builders_new.lua
unit_auto_group.lua
unit_bomber_control.lua
unit_cloakfirestate.lua
unit_dgun_stall_assist.lua
unit_customformations3.lua
unit_dgunhelper.lua
unit_improved_metal_maker.lua
unit_passive_nanos.lua
unit_marker.lua
gui_commandinsert.lua
unit_smart_nanos.lua
klapmongool wrote:@smoth3: I do not wanna knit my enemies a nice sweater filled with love. I want to use a unit that could be loads of fun but is being hindered by a silly rule (not automatically using its weapon on nmys).
smoth wrote: Thing is the not-auto fire status of that weapon is probably done on purpose but likely because you don't want it wasting time randomly you want it to focus on a target. Thing is if that was the case he could make it auto-hold fire on spawn. I have a gadget that does this in gundam, thing is PD.
A gadget to set em on auto-hold fire? PD? Public domain? What is the name? Maybe Senna could put that in then.
klapmongool wrote:Oh, ninja edit:
Smoth, ino no one is supposed to ask you this... but iv been looking forward to that tower defense mod since you started it... any chance its any time soon?
smoth wrote: Well, the short answer is quantum took over the reigns and added a bunch of cool features but the new pathfinder screwed it up for him so he stopped for a bit. I will revisit it later tonight and see if it is better again.
Awesome. Where can we track the progress?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Widget request: Automatically paralyse and capture

Post by Google_Frog »

smoth wrote:
klapmongool wrote:@smoth2: there are dozens of widgets that reduce the need for players to have apm.
Such as?
Pretty much all of them?

for example:
No resource bar -> lots of clicking required to figure out your income.
Awesome. Where can we track the progress?
  • Get Rapid list somehow (ZKL does this that I know of)
  • Download sd test
  • Host and play*
  • Optional extra: rage at pathfinder causing units to get stuck and cause massive slowdown
*Play might not work, currently unmaintained.
Post Reply

Return to “Lua Scripts”