Modding question - detecting a stop command

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

Modding question - detecting a stop command

Postby Kel » 28 Nov 2012, 22:10

EDIT: Ok, I already figured out how to do a lot of the stuff below. My question changes to: How do I detect a stop command being given to a unit? And on a side note, is there another way other than using a building's rallypoint to pass that building a position on the map?

First of all, I'm not sure this is the right forum, but there doesn't appear to be a modding subforum here, so apologies if this is in the wrong place.

Basically, I've got the QG to order a teleport on behalf of a unit:
Code: Select all
WarpNearbyUnits = function(self, radius)
   <some code>
       for k, v in nearbyunits do
          v:OnTeleportUnit(myteleporter, warplocation, v:GetOrientation())
       end
end

But the problem comes in that I can't cancel it - the teleporting unit will insist on doing the teleport, and putting a major drain on my economy for all that time, even if I change my mind. Interestingly, when holding shift no purple line appears to indicate a teleport, so the unit clearly doesn't recognise it's been given a teleport order.
A bit of searching leads me to believe there'll be no luck in actually ordering a teleport the way the game does it the rest of the time (so it accepts a cancel in the usual way), so I guess the next best thing is some sort of script that checks for a stop command and tells the teleport to stop if it receives one.

My question is: Is this possible, and if so how, or am I out of luck?
Last edited by Kel on 03 Dec 2012, 21:06, edited 2 times in total.
FA is good rts, but Tribes: Ascend is a good fps:
www.tinyurl.com/keltribes
Kel
 
Posts: 9
Joined: 20 Oct 2012, 00:08
Has liked: 0 time
Been liked: 0 time
FAF User Name: Kel

Re: Modding question - stopping a script-ordered teleport

Postby NotAsian » 30 Nov 2012, 16:15

Maybe try adding a hidden ability to the units in range that you then make the call to use. Should allow you to see the purple and should allow cancellation. just a idea though.
Make sure you remove the ability after teleport fails or succeeds if its possible.
Intentions for modification of next season of ladder
viewtopic.php?f=2&t=2030
very minor and feels like a waste.
NotAsian
Crusader
 
Posts: 48
Joined: 10 Sep 2012, 14:33
Has liked: 0 time
Been liked: 0 time
FAF User Name: NotAsian

Re: Modding question - stopping a script-ordered teleport

Postby Kel » 01 Dec 2012, 16:08

Don't think that's going to work, unfortunately. I could AddCommandCap teleport, and then perhaps use SetScriptBit to activate it... (I think, haven't mucked with this bit too much)
But then how do I tell it where to teleport to? Ain't gonna work.

I think I need to have a function which will detect a stop command, and cause the teleport to fail if it gets one. I just don't know enough to do that, 'tis all.
FA is good rts, but Tribes: Ascend is a good fps:
www.tinyurl.com/keltribes
Kel
 
Posts: 9
Joined: 20 Oct 2012, 00:08
Has liked: 0 time
Been liked: 0 time
FAF User Name: Kel

Re: Modding question - stopping a script-ordered teleport

Postby NotAsian » 02 Dec 2012, 19:04

There was a good mod around that I tried to acquire, UI mod called group attack UI it had allot of unit command modding you could easily re-purpose. Alas I dont have a copy of the mod and its been pulled from the internet, I suggest asking around to see if anyone's using/has it still.
You've probably already checked this avenue though.
What mods are you using for research atm? or are you experimenting and using forums?
Intentions for modification of next season of ladder
viewtopic.php?f=2&t=2030
very minor and feels like a waste.
NotAsian
Crusader
 
Posts: 48
Joined: 10 Sep 2012, 14:33
Has liked: 0 time
Been liked: 0 time
FAF User Name: NotAsian

Re: Modding question - detecting a stop command

Postby Kel » 03 Dec 2012, 21:05

Alrighty, I recently just figured out quite a lot of this stopping-a-teleport thing. There remains only really two links.

1) How do I detect a stop command being given to a unit?
2) Is there another way other than using a building's rallypoint to pass that building a position on the map?
FA is good rts, but Tribes: Ascend is a good fps:
www.tinyurl.com/keltribes
Kel
 
Posts: 9
Joined: 20 Oct 2012, 00:08
Has liked: 0 time
Been liked: 0 time
FAF User Name: Kel

Re: Modding question - detecting a stop command

Postby Lyr » 04 Dec 2012, 09:58

Can't you just make the stop and thus the eco drain come from the quantum gate, rather than the unit itself?
Lyr
Banned
 
Posts: 108
Joined: 14 Nov 2012, 18:55
Has liked: 3 times
Been liked: 5 times

Re: Modding question - detecting a stop command

Postby Kel » 06 Dec 2012, 21:14

I, uh... I don't really understand what you're saying. I'm calling a teleport on a unit using OnTeleportUnit, as part of a script the QG runs. The costs are part of that script.

I'm considering a couple of ideas, namely getting the QG to activate an ability on each unit that can call some sort of cancel function, or alternatively getting the QG to simply give the teleport ability to all units in range, both of which I reckon I could code... but they'd take a while and no doubt be bug-filled, so a quicker (and nicer) way of getting it working would be nice!
FA is good rts, but Tribes: Ascend is a good fps:
www.tinyurl.com/keltribes
Kel
 
Posts: 9
Joined: 20 Oct 2012, 00:08
Has liked: 0 time
Been liked: 0 time
FAF User Name: Kel


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron