[Request/Idea]Auto-cloak fusions

[Request/Idea]Auto-cloak fusions

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

Moderator: Moderators

Post Reply
GrapeFruit
Posts: 26
Joined: 06 Mar 2009, 14:19

[Request/Idea]Auto-cloak fusions

Post by GrapeFruit »

Is it possible to programm a widget that makes cloakable fusions (widely used in xta) cloak automatically when an enemy (air) scout approaches them?
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: [Request/Idea]Auto-cloak fusions

Post by Niobium »

To answer your question: Yes, quite easily.

Could be done in under 20 lines if you just did "If an enemy radar plane is seen, cloak all fusions". But could get complex if you want them to only cloak if plane is close to the fusions, or only if flying towards fusions. It would also be a bit tricky to implement uncloaking when coast is clear.
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: [Request/Idea]Auto-cloak fusions

Post by TheFatController »

This would probably be a good base for such a widget
http://spring.jobjol.nl/show_file.php?id=1579
User avatar
Tribulexrenamed
Posts: 775
Joined: 22 Apr 2008, 19:06

Re: [Request/Idea]Auto-cloak fusions

Post by Tribulexrenamed »

hmm good idea. i like the way you think.


i added this to my tribulex widget (the one that everyone hates that spams "ARM BOI RUNNING" points all over the map. lol)
User avatar
MidKnight
Posts: 2652
Joined: 10 Sep 2008, 03:11

Re: [Request/Idea]Auto-cloak fusions

Post by MidKnight »

Tribulex wrote:hmm good idea. i like the way you think.


i added this to my tribulex widget (the one that everyone hates that spams "ARM BOI RUNNING" points all over the map. lol)
I loled :P
computerquip
Posts: 42
Joined: 28 Dec 2008, 00:42

Re: [Request/Idea]Auto-cloak fusions

Post by computerquip »

I'm guessing the best way to do this is to make a timer that detects enemy units right? Or is there a way I can make an event function called when an enemy enters an area?
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: [Request/Idea]Auto-cloak fusions

Post by slogic »

Use UnitEnteredLos(unitID, unitTeam) callin or UnitEnteredRadar(unitID, unitTeam).
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: [Request/Idea]Auto-cloak fusions

Post by [Krogoth86] »

Why don't you just make a more simple but yet effective approach first? Simply do a widget that cloaks all fusions / whatever buildings else you want to cloak when you press a key. Doesn't auto-cloak but before you start ramming your head against a wall while thinking of a good way to determine when to cloak / uncloak (which might eat up some quite some precious CPU power) the approach of manually cloaking / decloaking everything in an easy and fast way is half the rent imo...

You usually see radar planes heading your direction anyway and know when they are dead so it's not too much to handle...
computerquip
Posts: 42
Joined: 28 Dec 2008, 00:42

Re: [Request/Idea]Auto-cloak fusions

Post by computerquip »

I'll make the both. One for keybinded cloaking, one experimental for auto-cloaking.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: [Request/Idea]Auto-cloak fusions

Post by Jazcash »

It'd be nice to have a cloaking option on factories so units are automatically cloaked when they exit their lab.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Re: [Request/Idea]Auto-cloak fusions

Post by Gnomre »

JAZCASH wrote:It'd be nice to have a cloaking option on factories so units are automatically cloaked when they exit their lab.
While it's not optional, the initcloaked FBI tag will make a unit cloak automatically upon build completion. If you'd prefer that default you could always request the mod maker to add it to the applicable units.
GrapeFruit
Posts: 26
Joined: 06 Mar 2009, 14:19

Re: [Request/Idea]Auto-cloak fusions

Post by GrapeFruit »

krogoths idea was quite simple but would really solve the problem.
unfortunatly im a java programmer and lua is c/c++ (at least wikipedia says so :?: )
ofc java is still better :mrgreen:

would be really nive if anyone could da that in some spare minutes of his life :-) ,

grapefruit


edit: what about cloaking the cloakable antis of xta too, when pressing the key?
computerquip
Posts: 42
Joined: 28 Dec 2008, 00:42

Re: [Request/Idea]Auto-cloak fusions

Post by computerquip »

I disagree with Java being more 1337! But that's for another discussion thread.

I recently had to stop learning the language due to spring break. Basically I became lazy. Anyways, I'm back in my groove and learning again.

Also, Lua isn't in C++ or even similar to C or C++ for that matter. Lua is syntactically similar to Javascript with BEGIN and END for function brackets.

As for the app, I'm still too ignant to know what I'm doing to make it properly. As a result, I wouldn't mind if someone warped ahead of me and finished it if anyone cared. It'll be another month before I start working on it (:P).
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: [Request/Idea]Auto-cloak fusions

Post by CarRepairer »

computerquip wrote:Also, Lua isn't in C++ or even similar to C or C++ for that matter. Lua is syntactically similar to Javascript with BEGIN and END for function brackets.
Erroneous. Perhaps if you BEGIN to look at some Javascript code it will put an END to your ego.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: [Request/Idea]Auto-cloak fusions

Post by trepan »

computerquip wrote:Also, Lua isn't in C++ or even similar to C or C++ for that matter. Lua is syntactically similar to Javascript with BEGIN and END for function brackets.
He got the lua part wrong, BEGIN is not a lua keyword ;-)

http://www.lua.org/manual/5.1/manual.html#8
Post Reply

Return to “Lua Scripts”