Jump to content


Photo

I could use some help makeing the AI use transport ships?


  • Please log in to reply
42 replies to this topic

#21 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 15 April 2012 - 02:47 PM

Ok. Thanks Ridder. :thumbsuphappy:

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#22 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 09 March 2014 - 01:39 PM

Hey guys.

 

Im going to resurrect this thread. :xx:

Im hoping someone will be able to shed some new light on it for me.

 

Im still working on trying to do it with the libraries files but still can't work out how to make the AI create a team to load into the transports. I have found all the teams in files like ai_attack_execution and have made a new team that I intend the AI to use. Im not sure how to get the AI to actually use though. Like do the teams need a script to trigger the building of them? Or, if i give the team a massive priority, will that be enough to get the AI to build it?

On the other hand, do I even need a new team? Like, the AI already has loads of teams and ideally all we want to do is get them to use the transports. Any ideas?

 

Thanks a  million Guys.


Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#23 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 09 March 2014 - 05:49 PM

I'm not sure if those teams and such are actually still used by BFME 2... they were used in BFME 1, maybe they got lazy and removed them...

But if not, then yes the team would need to be built :p


Ridder Geel

#24 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 09 March 2014 - 06:37 PM

Hey Ridder.

 

I reckon the teams are still being used because the libraries files are still being used. There a loads of bfme 2 stuff in the files so they must have been updated since bfme 1. Also, where else would controle/create the AI?

 

So, if im right and those files are still being used and i have made a new team in them (with a very high priority), will the AI just build it on its own or does a script somewhere need to start the team building?

 

 

Im not totally sure i have all this team/AI/Scripting stuff figured out yet. Like, I might be looking at it all wrong or not know major pieces of information that would help me understand it all. Pretty much everything i know about modding bfme, I have figgured out for myself with the help this forum or the tutorials at 3rd Age and im thinking that this is one of them times when I just can't figure it out without help. I kinda feel like im missing a single piece of information that would make it all fall into place for me. you know what i mean lol.   :facepalm:


Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#25 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 10 March 2014 - 12:01 AM

Well from what I gather the libraries are mostly used to just determine smaller things like audio, and the spellbook powers that the AI chooses.

The rest of the libraries are not linked to it... so most likely not used..

 

You have AI in...

aidata.ini

skirmishaidata.ini

playeraitypes.ini

and in all the objects and buttons, but those are for minor functionalities, such is why the AI should use this button to upgrade a building or such, or where it should use a spell.

 

The playeraitypes.ini includes something that might be of interest to you if you really want to see if you can script this kind of thing though.

PlayerAIType MenAI
    LibraryMap = "Libraries\AI_Men Of The West\AI_Men Of The West.map"
End

The same librarymap is used for EVERY singe AI... So obviously EA disbanded some previous method :p

All that is in that library map is the stuff for using spellbook spells, and the assigning of a butload of units to lists that were (I believe) used in BFME 1. (or somewhere before that) :p

You could write your own scripts in there that check if your AI has made a boat, if so make it find some sort of unit that it has built, and see if you could tell it to move that "unit" to the boat, and make them board it..

But then where would you make the boats sail and such... and how would you make the AI determine where to drop the units.

It is do-able, but as far as i know you would need to script a whole butload to make it work :p

I'd say try to do this to start off:

1. Find AI Boat object, make the script signal that it has found it

2. Find a AI team that can board the Boat, again signal somehow that the AI found it...

3. Move the AI team onto the boat, you will obviously see them board it.

Test it by making a 2 player game, you and an AI, both in the same team, and use a script on a map to reveal the entire map and remove fog of war, so you can see exactly what is happening.

Then... you wait?

Another possibility is look through all the INI files for some sort of AI related thing that could possibly do something like this -_-'

http://code.the3rdag...Category:Object

There are a lot of AI modules, but I have not written all those down, so you would have to find them yourself in existing code, and see if maybe they could help.

You might want to do that research before attempting the scripting that I suggested up there, because maaaaybe its not needed, but with EA and this not being in the actual game, it would surprise me if they actually made a module or such that did this for you and that they did not use it :p

Anyways.. its getting late over here (need to get up early to go to work nd such so yea...)... Sorry that I can't really be of much help, but I hope this has pointed u in some general direction of where to go with this...

Good luck, and may the force be with you :p Also, feel free to post here if you need specifics on what is in a module or whatever, I can "find" them on request, but that does take some time... I hope this post has at least helped you in some way :xd:


Edited by Ridder Geel, 10 March 2014 - 12:05 AM.

Ridder Geel

#26 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 10 March 2014 - 01:50 AM

Thanks a million for the reply Ridder.

 

Check that out! A BfME Wiki! Sign Me Up Now!  :thumbsupxd: I'll create a user account tomorrow.

 

 

You could write your own scripts in there that check if your AI has made a boat, if so make it find some sort of unit that it has built, and see if you could tell it to move that "unit" to the boat, and make them board it..

But then where would you make the boats sail and such... and how would you make the AI determine where to drop the units.

It is do-able, but as far as i know you would need to script a whole butload to make it work :p

I'd say try to do this to start off:

1. Find AI Boat object, make the script signal that it has found it

2. Find a AI team that can board the Boat, again signal somehow that the AI found it...

3. Move the AI team onto the boat, you will obviously see them board it.

Test it by making a 2 player game, you and an AI, both in the same team, and use a script on a map to reveal the entire map and remove fog of war, so you can see exactly what is happening.

Then... you wait

 

I have been trying to do exactly that but with no success. I can't even get the AI to load the ships. I had planned to send the ships to the nearest enemey owned shipwright but as I can't even get them to load, its a bit premature. I was trying to do all this in ai_attack_execution though. Do we think that it makes any difference if I do it there and not AI_Men Of The West?

 

I just had a quick look at the wiki link you gave and these two seem like they might be worth a look: SSZ01EA61C8_TransportAIUpdate and SSZ01EA68C0_AssaultTransportAIUpdate. How do I check them out?

 

Thanks a million Ridder :thumbsupcool:

 

Added: Just had a look at the Wiki, there doesn't seem to be a place to create a user account. Whats that about? :huh:


Edited by Titan Cronus, 10 March 2014 - 02:00 AM.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#27 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 10 March 2014 - 08:36 PM

Yes that might make a difference :p

The wiki... Good question... But well the wiki is currently work in progress from me, so not sure if there is a way to create an account for it yet (I'd have to ask phil) :p

Ill go and "decipher" those two modules for you... lets hope there is something good in there :p


Ridder Geel

#28 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 10 March 2014 - 09:10 PM

Thanks a million man. Your a star. :thumbsupsmiley:


Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#29 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 10 March 2014 - 09:23 PM

This one doesn't seem tooooo useful, but still:

    Behavior = TransportAIUpdate ModuleTag_TheTransportAIUpdate
        ;L01ED02F8:
        //Turret ;L00E3AD60 //Turret module
        AttackPriority = AttackPriority_Archer ;SUB_L006D4C30:String //Attack Priority from AIData.ini -> Obsolete
        AutoAcquireEnemiesWhenIdle = Yes ATTACK_BUILDINGS STEALTHED ;SUB_L006D3960 //L02233C7C //When may me auto aquire enemies?
        StopChaseDistance = 562 ;SUB_L006D46C0:Float Point Value //stop chasing after this distance
        StandGround = Yes ;SUB_L006D3400:Boolean //does this unit stand ground
        MoodAttackCheckRate = 250 ;SUB_L00E6CB10:Unsigned Integer Value //How often to check for changing to an attack mood
        CanAttackWhileContained = Yes ;SUB_L006D3400:Boolean //Can fire out of garrisoned building
        HoldGroundCloseRangeDistance = 40 ;SUB_L006D46C0:Float Point Value //Hold ground until the unit gets this close
        AILuaEventsList = InfantryFunctions ;SUB_L006D4C30:String //\data\scripts\scripts.lua <-Unit's LUA script
        MinCowerTime = 3000 ;SUB_L00E6CB10:Unsigned Integer Value //Min Cower Time
        MaxCowerTime = 5000 ;SUB_L00E6CB10:Unsigned Integer Value //Max Cower Time
        RampageTime = 7960 ;SUB_L00E6CB10:Unsigned Integer Value //How long to rampage
        RampageRequiresAflame = Yes ;SUB_L006D3400:Boolean //Requires Aflame state in order to rampage
        BurningDeathTime = 3000 ;SUB_L00E6CB10:Unsigned Integer Value //How long does the unit stay in burning death state
        TimeToEjectPassengersOnRampage = 2300 ;SUB_L00E6CB10:Unsigned Integer Value //This long until no longer able to eject passengers while rampaging
        ComboLocomotorSet = SET_COMBO ;SUB_L006D3B30 ;L02233CA8 //Force this locomoter set on the units in the horde
        ComboLocoAttackDistance = 500 ;SUB_L006D46C0:Float Point Value //Range for combo locomoter attack
        SpecialContactPoints = Repair ;SUB_L006D34D0:Object //Multiple Entries Allowed
        FadeOnPortals = Yes ;SUB_L006D3400:Boolean
    End

This one is practically the same except for the last two extra parameters, of which, to be honest, i'm not entirely sure what they would do. They are not used anywhere...

    Behavior = AssaultTransportAIUpdate ModuleTag_TheAssaultTransportAIUpdate
        ;SUB_L00E3AD40->L01ED02F8:
        //Turret ;L00E3AD60 //Turret module
        AttackPriority = AttackPriority_Archer ;SUB_L006D4C30:String //Attack Priority from AIData.ini -> Obsolete
        AutoAcquireEnemiesWhenIdle = Yes ATTACK_BUILDINGS STEALTHED ;SUB_L006D3960 //L02233C7C //When may me auto aquire enemies?
        StopChaseDistance = 562 ;SUB_L006D46C0:Float Point Value //stop chasing after this distance
        StandGround = Yes ;SUB_L006D3400:Boolean //does this unit stand ground
        MoodAttackCheckRate = 250 ;SUB_L00E6CB10:Unsigned Integer Value //How often to check for changing to an attack mood
        CanAttackWhileContained = Yes ;SUB_L006D3400:Boolean //Can fire out of garrisoned building
        HoldGroundCloseRangeDistance = 40 ;SUB_L006D46C0:Float Point Value //Hold ground until the unit gets this close
        AILuaEventsList = InfantryFunctions ;SUB_L006D4C30:String //\data\scripts\scripts.lua <-Unit's LUA script
        MinCowerTime = 3000 ;SUB_L00E6CB10:Unsigned Integer Value //Min Cower Time
        MaxCowerTime = 5000 ;SUB_L00E6CB10:Unsigned Integer Value //Max Cower Time
        RampageTime = 7960 ;SUB_L00E6CB10:Unsigned Integer Value //How long to rampage
        RampageRequiresAflame = Yes ;SUB_L006D3400:Boolean //Requires Aflame state in order to rampage
        BurningDeathTime = 3000 ;SUB_L00E6CB10:Unsigned Integer Value //How long does the unit stay in burning death state
        TimeToEjectPassengersOnRampage = 2300 ;SUB_L00E6CB10:Unsigned Integer Value //This long until no longer able to eject passengers while rampaging
        ComboLocomotorSet = SET_COMBO ;SUB_L006D3B30 ;L02233CA8 //Force this locomoter set on the units in the horde
        ComboLocoAttackDistance = 500 ;SUB_L006D46C0:Float Point Value //Range for combo locomoter attack
        SpecialContactPoints = Repair ;SUB_L006D34D0:Object //Multiple Entries Allowed
        FadeOnPortals = Yes ;SUB_L006D3400:Boolean
        ;L01EA9BC0:
        MembersGetHealedAtLifeRatio = 0.9 ;SUB_L006D46C0:Float //Something with healing?
        ClearRangeRequiredToContinueAttackMove = 200 ;SUB_L006D46C0:Float //Range required in order to continue attacking
    End

The large list with the numbers nd such in front have not yet been... well lets call it decrypted or whatever :p

So if you need to know one of those, then on request I can write them down, but this does take time :)


Edited by Ridder Geel, 10 March 2014 - 09:36 PM.

Ridder Geel

#30 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 10 March 2014 - 10:12 PM

Thanks man. That was super quick.

 

Your right, it doesn't seem like its at all useful. If i chose to use this code, i'd put it in the transport unit's file right? Maybe just having it there, it might make some difference. Like, maybe it will change how the AI sees the transport unit?

 

Just tried to load up the game to test my latest tweek and my computer will no longer reciognise the disc. I have been playing it nearly daily since the day it was release so not so bad i suppose. Major dissapointment. just looked on ebay for a new game, like 40 Euro minimum. :sad:


Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#31 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 10 March 2014 - 11:18 PM

Well not to promote pirating or anything, but you could torrent it. If you still have the serial code, its not even that bad at all :)

Yea i'd say try and see ;)


Ridder Geel

#32 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 11 March 2014 - 01:01 AM

If i can get my disc to play one last time can i just copy all the contents to my hardrive and then burn it back onto another disc or will that not work?


Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#33 MattTheLegoman

MattTheLegoman

    LEGO Knight of Minas Ithil

  • T3A Staff
  • 3,669 posts
  • Location:Tomorrow, when the War began
  • Projects:Mapping this Middle-earth
  •  Mapper
  • Division:BFME
  • Job:T3A Staff

Posted 11 March 2014 - 01:08 AM

Google how to get a disk working again. It helped me once with another disk.


Remember that all worlds draw to an end and that noble death is a treasure which no one is too poor to buy. - C.S. Lewis

There will come a time when you believe everything is finished. That will be the beginning. - Louis L'Amour

What will matter then will be people. If relationships will matter most then, shouldn't they matter most now? - Max Lucado


#34 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 11 March 2014 - 10:15 AM

Cheers for the suggestion Matt :good: but think it has done more harm than good. Not that it really makes much difference as it wasn't reading it before anyhoo. I tried to make a copy of the disc but when burning, it gave me some crap about not having permission on some file or some such bull.

I looked over the net for the iso file for RotWK but everything seems to be Torrents, like wtf is a torrent?! (You may have noticed that i clearly don't download stuff that often) Also, all the files seem to be for cracked versions that need total installs but all i need is a copy of the disc.

Looks like ebay after all.


Edited by Titan Cronus, 11 March 2014 - 10:24 AM.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#35 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 11 March 2014 - 11:27 AM

Hm.. Well ok that's a shame... Well hope you manage to find something :)


Edited by Ridder Geel, 11 March 2014 - 11:31 AM.

Ridder Geel

#36 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 12 March 2014 - 05:55 PM

Righty! Making some progress :thumbsupxd:

 

I can now get units to load into the transport ships. I have been testing with Isengard but will have to make copies of all the scripts for each faction. The problem now is making the transport ship move to the the enemy. Any Ideas guys?

 

 

Added: Just to let you know what i've tried;

*** IF ***
    True.
*** THEN ***
  Find the unit matching a type in the list 'ShipWright'nearest the teamTeam 'Evil Infantry Transport' (and owned by the teams Player) and set its reference to UnitRef 'Enemy Dock'
  Find the unit matching a type in the list 'ShipWright'nearest the teamTeam 'teamPlayer' (and owned by the teams Player) and set its reference to UnitRef 'Enemy Dock'
  Find 'ShipWright' Owned by Player '<This Player's Enemies>' nearest team Team 'Evil Infantry Transport' and reference as UnitRef 'Enemy Dock'
  Find 'ShipWright' Owned by Player '<This Player's Enemies>' nearest team Team 'teamPlayer' and reference as UnitRef 'Enemy Dock'
   Unit 'Isengard Transport Ship 1' begin attack on Unit 'Enemy Dock'
  AttackMove Team 'Evil Infantry Transport' to Unit 'Enemy Dock'.
  Team Team 'Evil Infantry Transport' will move to the nearest object of type 'ShipWright' that is owned by the player Player '<This Player's Enemy>'.

I have used several methods of referencing the enemy shipwright bacause at the time when i made the script, i though i was having problems referencing it but it was in fact a problem with the script that called for this script to be activated. I will at some point find out which one is actually referencing the shipwright and delete the others.

I have also tried several ways to get the the ship to head to the enemy dock too but none of them even make it move. The ship "Isengard Transport Ship 1" is the only thing in team "Evil Infantry Transport" so as you see, i have tried to make the ship move as a unit and a team.

 

Any Ideas would be well appriciated. Or, if you can see something wrong with my script or a way to refine/improve it, that would be equally welcome. :thumbsuphappy:


Edited by Titan Cronus, 12 March 2014 - 06:50 PM.

Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#37 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 12 March 2014 - 10:18 PM

Have you tried simply moving the ship there?

Or maybe doing something else to check if the position of the shipwright or wherever else u are trying to go is correct? :) You need to find out where the script is messing up ;)


Ridder Geel

#38 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 12 March 2014 - 11:02 PM

I can get the transport ship unit to move to a waypoint but not to another unit or object. I can't get the transport ship team (consisting of just the transport ship) to move anywhere at all. See, the thing is, Im trying to get it all to work in such a way that the AI will work in any map with Shipwrights without any editing to the map.

Ideally, I'd like to have a file at the end of this that people could just add to their game to get all the AI to use the transport ships. The initial file would only work with the normal factions but scripts for any new factions could be added just be copying and editing the existing scripts.


Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields


#39 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 12 March 2014 - 11:34 PM

So make sure that the object that they chose is actually being chose, try making the object it chooses to get destroyed.. believe there is a script that does that... should work...

Then you can check if the object is actually found or not... which oddly does not always happen...


Ridder Geel

#40 Titan Cronus

Titan Cronus

    Do unto Others...

  • Members
  • 693 posts
  • Location:Ireland
  • Projects:The Battle of the Pelennor Fields Mod.

Posted 13 March 2014 - 12:23 AM

Good idea. Tried it, it died! Then I tried killing the team.... nothing. So it's not making the team and if there's no team, i can't use the option to make the team (transport ship) move to a unit/structure. Unfortunatly that condition only exists for teams and not units. Not sure what elso I can do now. There's got to be a way.....


Battle of the Pelennor Fields

Made by 1 guy, has 13 Factions, 75+ Heroes, 150+ different units and 200+ Special abilities.

 

http://www.moddb.com...pelennor-fields





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users