Can these really cool features be implemented, if so how?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Can these really cool features be implemented, if so how

Post by commanderawesome »

You could assign the follow goal to a certain class, so the AI will follow anyone of that class, thus creating the illusion of squads.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Can these really cool features be implemented, if so how

Post by jedimoose32 »

That's the right idea for sure. I'm pretty sure if the <goal type> argument is "follow", the AddAIGoal function requires the <target> argument be an object.
ARC1778
Sergeant Major
Sergeant Major
Posts: 230
Joined: Sat Jun 20, 2015 7:44 am
Projects :: WARFRONT + Various Mods for Other Games
Games I'm Playing :: SWBF2+RC+RTW MTW NTW
xbox live or psn: AlexisVixie
Location: Glasgow, tumblr.

Re: Can these really cool features be implemented, if so how

Post by ARC1778 »

jedimoose32 wrote:That's the right idea for sure. I'm pretty sure if the <goal type> argument is "follow", the AddAIGoal function requires the <target> argument be an object.

that could work...... would it be easier just to edit the ai to let them use the "follow" like the player does? Or are we hitting more hardcoding there?
nobody3
Rebel Sergeant
Rebel Sergeant
Posts: 188
Joined: Wed Jun 15, 2011 8:30 am

Re: Can these really cool features be implemented, if so how

Post by nobody3 »

You cant do that. Search this forum for "formation" or "formations" and you should find a topic with similar thing you asked and maybe some answer
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Can these really cool features be implemented, if so how

Post by Teancum »

Off-topic: This just makes me miss the SWBF1 commands. Allies would follow loosely and not be in this rock-solid fighter formation. To dismiss someone following you requires literally spinning in a circle then quickly changing direction so you can target you ally and hit the button to make him stop following.
nobody3
Rebel Sergeant
Rebel Sergeant
Posts: 188
Joined: Wed Jun 15, 2011 8:30 am

Re: Can these really cool features be implemented, if so how

Post by nobody3 »

Doesn't the "follow loosely" thing work by using scriptaigoal "Defend" instead of "Follow" ? Unless you were talking just about non-modded push-a-button follow thing.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Can these really cool features be implemented, if so how

Post by jedimoose32 »

ARC1778 wrote:that could work...... would it be easier just to edit the ai to let them use the "follow" like the player does? Or are we hitting more hardcoding there?
Nope. This is literally what I've been saying will NOT be possible. Player "follow me" functionality is absolutely, completely, 100% hard coded. That's why I've suggested using the separate teams. It's the best work around.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Can these really cool features be implemented, if so how

Post by Teancum »

nobody3 wrote:Doesn't the "follow loosely" thing work by using scriptaigoal "Defend" instead of "Follow" ? Unless you were talking just about non-modded push-a-button follow thing.
non-modded push-a-button follow thing
ARC1778
Sergeant Major
Sergeant Major
Posts: 230
Joined: Sat Jun 20, 2015 7:44 am
Projects :: WARFRONT + Various Mods for Other Games
Games I'm Playing :: SWBF2+RC+RTW MTW NTW
xbox live or psn: AlexisVixie
Location: Glasgow, tumblr.

Re: Can these really cool features be implemented, if so how

Post by ARC1778 »

Teancum wrote:Off-topic: This just makes me miss the SWBF1 commands. Allies would follow loosely and not be in this rock-solid fighter formation. To dismiss someone following you requires literally spinning in a circle then quickly changing direction so you can target you ally and hit the button to make him stop following.
I know you could go to a comand post take it down to the point where the enemy could no-longer spawn, and then order to guys to hold it while you moved on. XD
jedimoose32 wrote:
Nope. This is literally what I've been saying will NOT be possible. Player "follow me" functionality is absolutely, completely, 100% hard coded. That's why I've suggested using the separate teams. It's the best work around.
Forgive my ignorance, I've not really got round to looking at the Lua. files yet, swimming in odfs's at the moment. I don't understand how the all follow FC command can work though.... ;/

I've actually re-written the teams: If the team number rotate script can be implemented, I'm thinking maybe just have it in the FC? Rather than a class which causes a change.

(New classes include: SBD Srg, Clone marksman, clone riflemen, clone srg, clone support, sniper droikdeka, 4 different commandos 6 different ARCs, engineers (Build defenses), pilots, drivers, scouts.......

I swear droidikeas come in tri-foration on the droid invasion map though.

Is it possible to order this class to follow this class?

Or can we trick the engine into thinking one of the AI's is a "player"?

I swear, one day i'll end up trying to re-write that EXE file. :runaway:

Is there anyway to implement the same feature from scratch?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Can these really cool features be implemented, if so how

Post by Teancum »

Long story short, it's not possible to do what you're wanting. AI scripting is pretty rudimentary in this game, so anything implemented wouldn't work worth a darn. It's just an old game that never focused much on scripting and AI, and there just aren't any LUA functions that, in combination, could give you the precision command you want. Sorry.
ARC1778
Sergeant Major
Sergeant Major
Posts: 230
Joined: Sat Jun 20, 2015 7:44 am
Projects :: WARFRONT + Various Mods for Other Games
Games I'm Playing :: SWBF2+RC+RTW MTW NTW
xbox live or psn: AlexisVixie
Location: Glasgow, tumblr.

Re: Can these really cool features be implemented, if so how

Post by ARC1778 »

Teancum wrote:Long story short, it's not possible to do what you're wanting. AI scripting is pretty rudimentary in this game, so anything implemented wouldn't work worth a darn. It's just an old game that never focused much on scripting and AI, and there just aren't any LUA functions that, in combination, could give you the precision command you want. Sorry.
There are always limitations, and always ways round them, sadly the way around seems to be to create a whole new game, and even if we had the skill, I think both Disney, and Dice might have a thing or two to say about that! XD

We have the team idea, that will suffice for the moment!

Wondering though, watch the CW episode on umbara, in which Fives using a minesweeper, is this idea possible, mines need to be detected rather than glowing?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Can these really cool features be implemented, if so how

Post by Teancum »

Nope. There is no functionality for anything like that. ODF parameters don't allow for it, and LUA can't hook into ODF files to create new parameters.
ARC1778
Sergeant Major
Sergeant Major
Posts: 230
Joined: Sat Jun 20, 2015 7:44 am
Projects :: WARFRONT + Various Mods for Other Games
Games I'm Playing :: SWBF2+RC+RTW MTW NTW
xbox live or psn: AlexisVixie
Location: Glasgow, tumblr.

Re: Can these really cool features be implemented, if so how

Post by ARC1778 »

Ah well.... Shame, wish we had the source code though, the M&B community can do so much with theirs... XD

I assuming if we give some unit's the Follow goal that so long as the unit they are following has the normal objectives, game play should still work?

Is there away to change goals mid-game? I assume that's how the campaign works?
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Can these really cool features be implemented, if so how

Post by Noobasaurus »

You can change goals using ClearAIGoals and then assigning them new ones.
ARC1778
Sergeant Major
Sergeant Major
Posts: 230
Joined: Sat Jun 20, 2015 7:44 am
Projects :: WARFRONT + Various Mods for Other Games
Games I'm Playing :: SWBF2+RC+RTW MTW NTW
xbox live or psn: AlexisVixie
Location: Glasgow, tumblr.

Re: Can these really cool features be implemented, if so how

Post by ARC1778 »

Noobasaurus wrote:You can change goals using ClearAIGoals and then assigning them new ones.

Is that something that can be done via FC? What kind of goals can be given? What about "Attack CP 1"?


EDIT
ARC1778 wrote:
Noobasaurus wrote:You can change goals using ClearAIGoals and then assigning them new ones.

Is that something that can be done via FC? What kind of goals can be given? What about "Attack CP 1"?

Also I'm back on that minesweep idea, what if mines were detected by all troopers, but could only be destroyed with one bit of kit?
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Can these really cool features be implemented, if so how

Post by Noobasaurus »

You can see the changing goals in action when you make enemies/allies follow you using FC. You'll also have to be more specific on the minesweep idea. What would the indicator look like when a mine is detected? Would the mine be completely invisible and blow up when someone gets too close? I'm fairly sure some of this is possible, because all the positions of the mines (or close to) could be recorded by using OnCharacterDispensePowerup, and then it would just record the rough position of the player (or adjusted, due to the velocity of the throw). Then if it was detected (AKA you get close enough or something), there could be an arrow (like the ones used in campaign) right above it so you would know that there's a mine around there.
ARC1778
Sergeant Major
Sergeant Major
Posts: 230
Joined: Sat Jun 20, 2015 7:44 am
Projects :: WARFRONT + Various Mods for Other Games
Games I'm Playing :: SWBF2+RC+RTW MTW NTW
xbox live or psn: AlexisVixie
Location: Glasgow, tumblr.

Re: Can these really cool features be implemented, if so how

Post by ARC1778 »

Noobasaurus wrote:You can see the changing goals in action when you make enemies/allies follow you using FC. You'll also have to be more specific on the minesweep idea. What would the indicator look like when a mine is detected? Would the mine be completely invisible and blow up when someone gets too close? I'm fairly sure some of this is possible, because all the positions of the mines (or close to) could be recorded by using OnCharacterDispensePowerup, and then it would just record the rough position of the player (or adjusted, due to the velocity of the throw). Then if it was detected (AKA you get close enough or something), there could be an arrow (like the ones used in campaign) right above it so you would know that there's a mine around there.
The idea was the mine would be invisible, but there would be an item which when held down would reveal their position (Prefferably by turning 'em blue), Tean seemed pretty sure that wasn't possible, so the counter idea was that mine could only be shot sucessfully with a minesweeper, which would only harm mines, etc.

One assume that if a unit with the "follow sargent class" goal lost the sarget they'd go back to "standing orders"?
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Can these really cool features be implemented, if so how

Post by Noobasaurus »

Okay, so it would just turn them blue based on their position that is recorded like I said earlier. It would just be some simple effect attached to the mine, and when the detecting weapon was used, would appear. However, the mine effects would appear for both teams. In SP, it wouldn't matter anyway.
ARC1778
Sergeant Major
Sergeant Major
Posts: 230
Joined: Sat Jun 20, 2015 7:44 am
Projects :: WARFRONT + Various Mods for Other Games
Games I'm Playing :: SWBF2+RC+RTW MTW NTW
xbox live or psn: AlexisVixie
Location: Glasgow, tumblr.

Re: Can these really cool features be implemented, if so how

Post by ARC1778 »

Excellent.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Can these really cool features be implemented, if so how

Post by [RDH]Zerted »

I tried to add a shortcut key to the spawn button but was unsuccessful. If I though that was possible it would have been in v1.3. The spawn selection screen is an odd screen. Part of it is controlled normally through Lua and another part is controlled by the exe, or so it appeared to me.

I don't think you can prevent a health/ammo droid from helping a specific team, but they are objects so you could put them on a team that's an enemy of the team you don't want them to help. In theory, the bots will destroy the droids before they get help from them. I don't know if they'll try to repair it at the same time.

You can add unit classes to a team until you hit the limit. You can't remove them. Swapping is removing then adding or adding then removing. Both ways require removing, so both ways aren't possible. Since we can only fake moving humans onto 3rd party teams and not truly move them, humans can only use unit classes from teams 1 and 2. You can swap people between those teams and 'move' the AIs onto whatever teams.


You don't have to separate the AI into teams, but there are a limited number of AI goals. This is a global limit, not a team limit. It can be done, but not on the scale you want to use it and you won't be able to pick which bots follow the orders (unless you dynamically move them to other teams). The AI goals work on percentages. You can only say things like 50% of the bots go do this. Actually, you will need to use teams. The unit being followed can't be on the same teams as the followers else he'll run in circles trying to follow himself (unless he's a human player). That's all possible, but you have to know what you're doing to code it properly.

You might not be able to change the spawn button, but you could probably add another control to that screen showing the Red/Green status. Players can't spawn if there are no available spawn points. You can programmatically turn off the CPs until a given time which is one way to prevent people from spawning.


I would suggest starting with creating the different types of CPs. If you can't do that you won't be able to do the more complex coding tasks.
Post Reply