Page 2 of 2

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

Posted: Fri Jul 03, 2015 11:08 pm
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.

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

Posted: Sat Jul 04, 2015 12:01 am
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.

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

Posted: Sat Jul 04, 2015 8:32 am
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?

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

Posted: Sat Jul 04, 2015 9:14 am
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

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

Posted: Sat Jul 04, 2015 9:56 am
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.

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

Posted: Sat Jul 04, 2015 10:02 am
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.

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

Posted: Sat Jul 04, 2015 12:21 pm
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.

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

Posted: Sat Jul 04, 2015 11:38 pm
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

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

Posted: Sun Jul 05, 2015 7:38 am
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?

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

Posted: Sun Jul 05, 2015 10:05 am
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.

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

Posted: Sun Jul 05, 2015 11:18 am
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?

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

Posted: Sun Jul 05, 2015 11:28 am
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.

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

Posted: Sun Jul 05, 2015 11:59 am
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?

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

Posted: Sun Jul 05, 2015 12:09 pm
by Noobasaurus
You can change goals using ClearAIGoals and then assigning them new ones.

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

Posted: Sun Jul 05, 2015 12:24 pm
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?

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

Posted: Sun Jul 05, 2015 12:31 pm
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.

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

Posted: Sun Jul 05, 2015 12:42 pm
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"?

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

Posted: Sun Jul 05, 2015 12:51 pm
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.

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

Posted: Sun Jul 05, 2015 1:01 pm
by ARC1778
Excellent.

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

Posted: Mon Jul 13, 2015 12:30 am
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.