Page 1 of 1

[Request/Idea]Auto-cloak fusions

Posted: 06 Mar 2009, 14:33
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?

Re: [Request/Idea]Auto-cloak fusions

Posted: 06 Mar 2009, 15:07
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.

Re: [Request/Idea]Auto-cloak fusions

Posted: 06 Mar 2009, 19:30
by TheFatController
This would probably be a good base for such a widget
http://spring.jobjol.nl/show_file.php?id=1579

Re: [Request/Idea]Auto-cloak fusions

Posted: 25 Mar 2009, 00:39
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)

Re: [Request/Idea]Auto-cloak fusions

Posted: 25 Mar 2009, 00:43
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

Re: [Request/Idea]Auto-cloak fusions

Posted: 27 Mar 2009, 00:25
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?

Re: [Request/Idea]Auto-cloak fusions

Posted: 27 Mar 2009, 13:04
by slogic
Use UnitEnteredLos(unitID, unitTeam) callin or UnitEnteredRadar(unitID, unitTeam).

Re: [Request/Idea]Auto-cloak fusions

Posted: 28 Mar 2009, 12:35
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...

Re: [Request/Idea]Auto-cloak fusions

Posted: 29 Mar 2009, 09:13
by computerquip
I'll make the both. One for keybinded cloaking, one experimental for auto-cloaking.

Re: [Request/Idea]Auto-cloak fusions

Posted: 29 Mar 2009, 10:02
by Jazcash
It'd be nice to have a cloaking option on factories so units are automatically cloaked when they exit their lab.

Re: [Request/Idea]Auto-cloak fusions

Posted: 29 Mar 2009, 20:22
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.

Re: [Request/Idea]Auto-cloak fusions

Posted: 29 Mar 2009, 20:28
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?

Re: [Request/Idea]Auto-cloak fusions

Posted: 02 Apr 2009, 06:09
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).

Re: [Request/Idea]Auto-cloak fusions

Posted: 03 Apr 2009, 22:50
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.

Re: [Request/Idea]Auto-cloak fusions

Posted: 04 Apr 2009, 02:56
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