Jump to content


Photo

AI script:: "if player 2 = Comp. controlled do this action..."


  • Please log in to reply
19 replies to this topic

#1 Goldtouch

Goldtouch

    title available

  • Hosted
  • 449 posts

Posted 03 August 2010 - 07:32 AM

Hellow worldbuilders

So I have this heroes vs waves map.. I want to make the AI smarter by putting them on tactical spots or let them heal etc.
But here is the problem 'How can I tell the engine only to do certain commandos =if= the player is not controlled by a human but for example a hard computer'.

#2 JUS_SAURON

JUS_SAURON

    El Shaddai

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

Posted 04 August 2010 - 01:57 AM

I am no pro Scripter but The Player 1 folders are for Both AI and Human Players
While the Skirmish Folders handle Only AI stuff

Eg in SkirmishMordor : If this player is being attacked do this Script etc...

This will only be carried out by the AI SkrimshMordor

Something like : In SkirmishMordor Folder ect

If this player is starting position 1 THEN

Edited by JUS_SAURON, 04 August 2010 - 02:09 AM.


#3 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 14 August 2010 - 12:28 PM

Have you looked through the IF conditions? I have a feeling there is a simple condition which discriminates between human and non-human players like that.
Posted Image

#4 Goldtouch

Goldtouch

    title available

  • Hosted
  • 449 posts

Posted 14 August 2010 - 01:44 PM

Plz go look for yourself. Let me know if you know it ^^

#5 Lauri

Lauri

    Old man Lauri

  • Hosted
  • 10,438 posts
  • Location:Norway
  • Projects:The 4th Age
  •  The very worst T3A Team Chamber Member

Posted 14 August 2010 - 02:34 PM

Or you could try to look yourself, since you're the one asking for help... :p

T4A_Logo_-_article.png

The 4th Age version 0.8 has been released: Link


#6 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 17 August 2010 - 12:20 PM

Ok I decided to have a quick look through and I couldn't see anything, so just try JUS_SAURON's suggestion. It might turn out that using those folders only applies to single player mode (just a suspicion), in which case look through worldbuilder yourself for solutions, make certain spots only for (scripted) AI players or just decide that tactical markers (or nothing at all) is good enough.
Posted Image

#7 Rob38

Rob38

    Believer of Hope

  • Hosted
  • 3,567 posts
  • Location:USA
  • Projects:Helm's Deep Last Hope
  •  One who is not afraid of new challenges

Posted 18 August 2010 - 01:29 PM

I got WB scripts to recognize whether the player is human or computer controlled. Cannot remember at the moment what I did. Whenever I get the chance to delve into my modding files, I'll see if I can pull it up.

signature_group1.gif

 

16821.png


#8 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 18 August 2010 - 01:33 PM

Isnt that easy? You check if the player has one of these upgrades:
Upgrade Upgrade_EasyAISinglePlayer
Upgrade_MediumAISinglePlayer
Upgrade_HardAISinglePlayer
Upgrade_EasyAIMultiPlayer
Upgrade_MediumAIMultiPlayer
Upgrade_HardAIMultiPlayer

If he does not then its a Human :p At least thats what i think...
Ridder Geel

#9 Rob38

Rob38

    Believer of Hope

  • Hosted
  • 3,567 posts
  • Location:USA
  • Projects:Helm's Deep Last Hope
  •  One who is not afraid of new challenges

Posted 18 August 2010 - 01:36 PM

Now that you mention it, that may be what I did.

signature_group1.gif

 

16821.png


#10 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 18 August 2010 - 06:12 PM

Problem solved then - I didn't think of that. :p
Posted Image

#11 Zdav'

Zdav'
  • Members
  • 8 posts

Posted 30 December 2010 - 09:48 AM

Ive done this and it doesn't works :thumbsupsmiley:

*** IF ***
	Player Player 'Player_1' built Upgrade 'Upgrade_EasyAIMultiPlayer'.
  *** OR ***
	Player Player 'Player_1' built Upgrade 'Upgrade_EasyAISinglePlayer'.
  *** OR ***
	Player Player 'Player_1' built Upgrade 'Upgrade_HardAIMultiPlayer'.
  *** OR ***
	Player Player 'Player_1' built Upgrade 'Upgrade_HardAISinglePlayer'.
  *** OR ***
	Player Player 'Player_1' built Upgrade 'Upgrade_MediumAIMultiPlayer'.
  *** OR ***
	Player Player 'Player_1' built Upgrade 'Upgrade_MediumAISinglePlayer'.
*** THEN ***
  Give Unit Unit 'Treb_Lv2_1' the upgrade Upgrade 'Upgrade_TrebuchetTurret'.
  Give Unit Unit 'Treb_Lv2_2' the upgrade Upgrade 'Upgrade_TrebuchetTurret'.
  Give Unit Unit 'Treb_Lv2_3' the upgrade Upgrade 'Upgrade_TrebuchetTurret'.
  Give Unit Unit 'Treb_Lv2_4' the upgrade Upgrade 'Upgrade_TrebuchetTurret'.
  Give Unit Unit 'Treb_Lv2_5' the upgrade Upgrade 'Upgrade_TrebuchetTurret'.
  Give Unit Unit 'Treb_Lv2_6' the upgrade Upgrade 'Upgrade_TrebuchetTurret'.

Those scripts are in Player_1 folder
I know that scipts actions are ok
Is somebody can help me please

Edited by Zdav', 30 December 2010 - 09:51 AM.


#12 Elrond99

Elrond99

    title available

  • Hosted
  • 464 posts
  • Location:Austria
  • Projects:None at the moment
  •  Modder without work and time :-S

Posted 31 December 2010 - 06:02 PM

Brutal AI is missing :thumbsupsmiley:

If that doesn´t help I would look for something like if player has upgrade, instead of built

But my first guess is the lack of the Brutal AI Upgrades

#13 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 31 December 2010 - 06:26 PM

They do not exist :xcahik_:
Brutal is Hard with cheats :thumbsupsmiley:
Ridder Geel

#14 Zdav'

Zdav'
  • Members
  • 8 posts

Posted 01 January 2011 - 01:21 AM

Brutal AI is missing :thumbsupsmiley:

If that doesn´t help I would look for something like if player has upgrade, instead of built

But my first guess is the lack of the Brutal AI Upgrades


I forgot to mention that it was for WB BFME 1.

I was thinking of "has upgrade" but it does not exist :(

btw thanks for the help :xcahik_:

#15 Zdav'

Zdav'
  • Members
  • 8 posts

Posted 07 January 2011 - 10:48 AM

The upgrade option was a good one, but it does not works :D

No more available solutions to identify AI players?

Edited by Zdav', 07 January 2011 - 10:49 AM.


#16 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 07 January 2011 - 11:10 AM

That depends if you want to make it be only a map or an actual mod. if you make it a mod, its quite easy to do... :D
Though you could try this...
Check for each player if they have AI_On flag set to true or not. True means its AI ;)
Just make a script in each' player's script folder that checks for AI_On == true
if it is true then make it set a new counter or whatever like "Player_1_AI" to 1
that way you could check which of the players are AI. So you could make scripts for each player that does whatever you want for them.

Edited by Ridder Geel, 07 January 2011 - 11:10 AM.

Ridder Geel

#17 Zdav'

Zdav'
  • Members
  • 8 posts

Posted 07 January 2011 - 03:07 PM

Thanks for reply

Unfortunatly, actually it s for a map without ini modifications, ive did a multiplayer one, and i wanted to create an AI version wich one is a little improved, like managing gates, build buildings and upgrades...

I saw if add AI in "player list" that AI scripts appears as 'imported scripts" in scripts section, so there is diffenrent kind of AI and i don't know what to use, and what can i do with.

Btw take a look to my map: Middle Earth

#18 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 07 January 2011 - 04:53 PM

I think if you do what i told up there, it might work, because those things are defined for each AI, so it should work.

Though you could try this...
Check for each player if they have AI_On flag set to true or not. True means its AI
Just make a script in each' player's script folder that checks for AI_On == true
if it is true then make it set a new counter or whatever like "Player_1_AI" to 1
that way you could check which of the players are AI. So you could make scripts for each player that does whatever you want for them.


Ridder Geel

#19 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 08 January 2011 - 01:36 PM

By the way, are you certain that the problem with the script is the IF conditions? You might just want to add the THEN consequence of creating a beacon in the middle of the map at the top of your THEN list to make sure it isn't the upgrade to the unit that isn't working. Not that there is a strong possibility that this is the case, it just seems logical to rule out that possibility.

If you simply can't find a way to do this, maybe it would work to trap a named unit in a box of ground impassible for human players (passible in the middle where the unit is) - hopefully AI players would use that unit and it would move out of the box and human players wouldn't be able to, thereby creating a possibility to differentiate between AI and human (albeit crudely). This might even work outside the visible map, making any humans blissfully aware of their trapped comrades.

Edited by Puzzler33, 08 January 2011 - 01:37 PM.

Posted Image

#20 Zdav'

Zdav'
  • Members
  • 8 posts

Posted 11 January 2011 - 08:10 PM

I think if you do what i told up there, it might work, because those things are defined for each AI, so it should work.

Though you could try this...
Check for each player if they have AI_On flag set to true or not. True means its AI
Just make a script in each' player's script folder that checks for AI_On == true
if it is true then make it set a new counter or whatever like "Player_1_AI" to 1
that way you could check which of the players are AI. So you could make scripts for each player that does whatever you want for them.



It works perfectly! :sleep:
I will able to make a singleplayer version for my map
Thanks a lot for your advice.

And good work for your mod!!! I haven't played BFME/ROTWK for years, but since i discove your mod it is one more reason for me to install it again :p .

Edited by Zdav', 11 January 2011 - 11:01 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users