Page 1 of 2

run (whatever) on self-destruct sequence begun

Posted: 17 Jul 2007, 01:03
by Caydr
What the subject says... the ability to have a script automatically run when self-d process has started. A second script would begin if the self-destruct was terminated.

Posted: 17 Jul 2007, 03:06
by Peet
Most likely possible with luacob.

Posted: 17 Jul 2007, 16:43
by Zoy64
what happens if you set Self-D and the targeted units runs......into your own base?! And by the time that you tell him to stop Self-D-ing.....

KABOOOM!

Posted: 17 Jul 2007, 22:11
by Caydr
Zoy64 wrote:what happens if you set Self-D and the targeted units runs......into your own base?! And by the time that you tell him to stop Self-D-ing.....

KABOOOM!
:|

So ANYWAY, can someone decribe how this is done with "luacob"? To take a guess, "Luacob" involves LUA, which I can't read, and cob, which I can't write.

Posted: 17 Jul 2007, 22:41
by manored
Script to make a lot of red lights pop out of the unit while its head spins around madly and it yells "DANGER! DANGER! DANGER!" ? It would be fun to watch :)

But talking serious now, where you want to use that on?

Posted: 17 Jul 2007, 23:29
by Caydr
I thought it'd be useful for a certain unit to give a visual indication when it's going to self-destruct, to both allies and enemies.

Posted: 07 Sep 2007, 00:59
by Caydr
*rez*

If this is possible, can someone show me how to implement it? I can't emphasize enough how much it'd improve a certain something I'm working on.

Posted: 07 Sep 2007, 01:37
by imbaczek
e-z. look at caspring to see how it's done these days. maybe even perhaps *gasp* ask them ^^

Posted: 07 Sep 2007, 03:15
by Caydr
I have no idea what's going on with CA... I'm purposefully avoiding looking at it so I can keep my ideas original. They have a unit like this already?

Posted: 07 Sep 2007, 08:27
by KDR_11k
On AllowCommand for Self-D make a COB call.

Posted: 07 Sep 2007, 19:34
by Caydr
:shock:

Can you post a working bit of code? I really have no idea how to make this LUA stuff, I can just modify what I already have. Once I get my shift change I'll have to learn LUA...

Posted: 08 Sep 2007, 16:46
by manored
I dont think that a suiciding unit should show that it is going to make boom... its just activating a bomb into itself, isnt it? And the 5 or 10 seconds of antecipation are just for the case of you incidentally pressing the self-d button (or so I think). And its even weird that all units can self-d: True that everone should have the ability to eliminate the own units, but isnt it a bit expensive to give all units a bomb to selfdestruction? :)

Posted: 09 Sep 2007, 00:25
by Caydr
This isn't intended for conventional "oh no my AK is going to be captured! I'll be ruined! wait a minute.... *ctrl+d" HAHAHAHA I WIN!!!" scenarios.

Posted: 10 Sep 2007, 22:43
by Caydr
Please can someone post a working example? I'm really desperate, I've got this great idea that could be made exponentially better by showing when self-d has started.

Posted: 10 Sep 2007, 23:07
by Forboding Angel
manored wrote:I dont think that a suiciding unit should show that it is going to make boom... its just activating a bomb into itself, isnt it? And the 5 or 10 seconds of antecipation are just for the case of you incidentally pressing the self-d button (or so I think). And its even weird that all units can self-d: True that everone should have the ability to eliminate the own units, but isnt it a bit expensive to give all units a bomb to selfdestruction? :)
No offense manored... but who are you to tell us what features we want to have in our mods?

Posted: 12 Sep 2007, 23:17
by Caydr
He's a potential helper, which makes him god for the duration of this thread (or until I find someone better ^^)

Posted: 13 Sep 2007, 12:32
by SwiftSpear
Why not just have it possible to override the self-d sequence entirely and replace it with your own scripted sequence triggered by ctrl-d. I imagine the majority of mods would maintain the self-d sequence for all units, but I know some mods basically don't allow self-d at all currently, so why force them to use cudgeled work arounds when it should really be replaceable entirely anyways?

Posted: 13 Sep 2007, 12:51
by KDR_11k
CommandFallback or something like that.

Posted: 13 Sep 2007, 22:24
by Caydr
I would gladly try that if I knew how. Can someone give me some example code to work with?

Posted: 14 Sep 2007, 03:44
by trepan
CommandFallback() only works for commands that the engine does
not recognize. You can intercept the real SELFD commands with the
AllowCommand() call-in, and insert your own custom commands if
you want to use CommandFallback(). This might be useful if you want
to allow using queued custom selfd's.