Rally Squad Weapon? (LUA)
Moderator: Moderators
- Sky_216
- Droid Pilot Assassin

- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Rally Squad Weapon? (LUA)
Thought about this for a while...would it be realistically possible to give command units (ie clone captains, OOM droids, etc) a "Rally Squad" weapon....ie a weapon that works like a buff, but gets a few allies to follow the unit who used it around (so some AI work in squads). Way I thought of doing it is:
Use "on hit by last weapon" (or whatever its called) code.
If team is same as user (ie team 1 or 2) then set those hit by it to follow the user (not sure what the code for this is but since it's in fakeconsole assume there is one).
Other question is 'would this cause online crashing?'
Anyway thanks to anyone who can shed light on this.
Use "on hit by last weapon" (or whatever its called) code.
If team is same as user (ie team 1 or 2) then set those hit by it to follow the user (not sure what the code for this is but since it's in fakeconsole assume there is one).
Other question is 'would this cause online crashing?'
Anyway thanks to anyone who can shed light on this.
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Rally Squad Weapon? (LUA)
You're a better coder than I; but if it counts for anything my opinion is the same as yours, that it should be possible. GetObjectLastHitWeaponClass or something, then check the team and set an AI goal, I think it is.
I'm guessing it won't work online since that "Follow me" command doesn't work online. Or...does it? I think I've checked before, but I've forgotten the results of that test.
I'm guessing it won't work online since that "Follow me" command doesn't work online. Or...does it? I think I've checked before, but I've forgotten the results of that test.
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Rally Squad Weapon? (LUA)
there is a follow aigoal, it should work online too
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Rally Squad Weapon? (LUA)
The "Follow Me" command works fine online if you are the server host. Like others mention, it messes with the AI goals. There is a limit to the number of AI goals. If you go over the limit (check the limits topic), the game crashes.
- Sky_216
- Droid Pilot Assassin

- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Rally Squad Weapon? (LUA)
Ah, okay. Can the folllow me AI goal be applied to a select few units or will it be applied to the whole team of units?
- vampire_lord
- Rebel Sergeant

- Posts: 216
- Joined: Thu Mar 20, 2008 7:02 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Mexico City
- Contact:
Re: Rally Squad Weapon? (LUA)
It doesn't display the order but you can command up to 2 bots with F4 as if you were doing it offline, lag comes into play though you might see them loafing around sometimes as if you were idle with them too much time.Fiodis wrote:I'm guessing it won't work online since that "Follow me" command doesn't work online. Or...does it? I think I've checked before, but I've forgotten the results of that test.
- trainmaster611
- Sith Lord

- Posts: 1779
- Joined: Thu Aug 24, 2006 5:22 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Building a railway to Coruscant
- Contact:
Re: Rally Squad Weapon? (LUA)
I don't know if this helps but I know AI will follow you in CTF if you have the flag. I looked at the ObjectiveCTF script but nothing in particular stood out that would explain why they do that. I dunno if its just the same idea behind the "follow me" command though.
- Frisbeetarian
- Jedi

- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Rally Squad Weapon? (LUA)
What DarthD.U.C.K. was referring to was the "Follow" AI goal, which, just like the other ones ("Deathmatch" "Defend" "Destroy" etc.), apply to the whole team. You can use weights however to apply it to a certain number (approximately), but you can specify which will do it (I'm not sure how the game chooses which AI follow that goal). However, the "Follow" goal seems to be only applicable to a Game Object, and not a Character Index, thus you might want to use "Defend."Skyhammer_216 wrote:Ah, okay. Can the folllow me AI goal be applied to a select few units or will it be applied to the whole team of units?
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Rally Squad Weapon? (LUA)
Your first sentence is a little messed up. AI goals have weights. The percentage of a goal's weight from the total defined AI goal weights is about the percentage of AI bots that will attempt to do that goal. You cannot control exactly which bot follows what AI goal.Frisbeetarian wrote:You can use weights however to apply it to a certain number (approximately), but you can specify which will do it (I'm not sure how the game chooses which AI follow that goal). However, the "Follow" goal seems to be only applicable to a Game Object, and not a Character Index, thus you might want to use "Defend."
I thought you could use character indexes with the Follow goal, but its been a while... If you can't, then use the goal on the character's unit. Don't forget to delete the AI goal after the unit dies. Too many AI goals will crash the game.
If only one player on a team will be able to use this weapon, setup an allied local team for each main team (ATT and DEF). Setup all your CPs to allow allied unit spawning. When a player uses the weapon, add the follow AI goal to the local team representing that player's main team. When that player dies, delete the AI goal. When a team has a goal, its bots will spawn. When a team has no goals, its bots stop spawning.
- Frisbeetarian
- Jedi

- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Rally Squad Weapon? (LUA)
That's exactly what I meant to say, I just got a little messed up thinking about something else.[RDH]Zerted wrote:You cannot control exactly which bot follows what AI goal.
I haven't checked the character indices myself, I got my information from one of Psych0fred's docs.
