Jump to content


Photo

Scripting help needed

i am rusty or was never good

  • Please log in to reply
7 replies to this topic

#1 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 30 September 2018 - 08:12 PM

So I want to do the following in BFME2

AI unpack Econ plots
(They do but not as often as I would like )
(After 1 hour they may only unpack 1, not even the one near their base)

So this is my steps

1. AI builds structure - ORC PIT- Works
2. AI checks if Structure exists and build team - ECON1
3.AI sends Team ECON1 to economy_plot_1 unit
4.AI checks if the threat is 0 , if there are no enemies , or the plot is not owned by an ally
5. Econ plot is transferred to that AI player
6. AI builds a lumbermil

It seems to not be working , as far as I can tell
They do build the Orcpit , in Skirmish Mordor,

Help is welcomed
I will keep at it and update this thread

#2 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 30 September 2018 - 11:00 PM

Some more testing
So I can spawn a team MordorfighterHorde near a unit Orcpit ,
But I cannot build the team from the pit?

If unit Orcpit exist , spawn a team near the Orcpit - works
If unit Orcpit exists , start building team FROM the Orcpit - not fictional

How the hell do I get a Structure to build a named team ?

#3 Fudge

Fudge

    title available

  • Project Team
  • 531 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

Posted 01 October 2018 - 06:57 AM

Are you trying to run this in skirmish or campaign mode? If you're running this in BFME 2 then the AI player needs to be PlyrCreeps otherwise the AI's default scripts will override yours.

 

I'll have a go myself and see what if I can get this working.


Edited by Fudge, 01 October 2018 - 07:01 AM.


#4 Fudge

Fudge

    title available

  • Project Team
  • 531 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

Posted 01 October 2018 - 10:58 AM

Yeah I've made a little test map to demonstrate this issue - its a real pain in the arse! The map tells PlyrCreeps to unpack a base, build some buildings and then build a team to capture Economy Plots. When they're factionCivilian they cannot build the bases but will build the teams if provided buildings already, when they're FactionMordor they will build the buildings but will not build the teams.

I don't know how you got the AI to unpack an Economy Plot, but I am still very new to this whole AI scripting business. Sorry if this has just made everything more complicated!

But to reiterate:
- Player has to be PlayerCreeps/PlayerCivilian to preventdefault AI scripts overriding everything you do
- PlayerCreeps/PlayerCivilian are both FactionCivilian so they cannot build any buildings/unpack any plots.
- If you make PlayerCreeps FactionMordor they will unpack the bases but then their default AI will make their own teams and not the ones you specified for them

https://1drv.ms/u/s!...gSkQY8WfW5g_W1Q


Edited by Fudge, 01 October 2018 - 10:59 AM.


#5 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 02 October 2018 - 06:09 AM

Thanks , I will download and test more
Any way to switch the Orcpit to player Creeps , switch allegiance of Mordor and Creeps to friendly
Then have player Creeps build my team , do the necessary actions , and switch back ?

I tried but did not work .

I will download your map and see your scripts

I guess recoding AI is what must be done ....which is probably the hardest task I have ever undertaken

At least I game the AI does actually build econ plots on their own , even before all this new scripting
I just wanted a more aggressive build strategy , like how they currently build farms as they start

#6 Fudge

Fudge

    title available

  • Project Team
  • 531 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

Posted 02 October 2018 - 06:14 AM

BFME 2 does AI differently though. Its all .bse files instead of library maps and I have no idea how to edit them!



#7 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 02 October 2018 - 08:49 AM

The .bse files can be opened with WB.

 

Just remember to save them as a .bse file in the Bases tab.


Edited by MattTheLegoman, 02 October 2018 - 08:49 AM.

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


#8 Fudge

Fudge

    title available

  • Project Team
  • 531 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

Posted 03 October 2018 - 06:27 AM

Really. I'll have to tale a look, cheers Matt.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users