18. Feb 2019, 15:24 Hallo Gast.
Willkommen Gast. Bitte einloggen oder registrieren. Haben Sie Ihre Aktivierungs E-Mail übersehen?

Einloggen mit Benutzername, Passwort und Sitzungslänge. Hierbei werden gemäß Datenschutzerklärung Benutzername und Passwort verschlüsselt für die gewählte Dauer in einem Cookie abgelegt.

Select Boards:

Autor Thema: Is it possible to program the AI?  (Gelesen 956 mal)


  • Edain Betatesting
  • Elronds Berater
  • ***
  • Beiträge: 331
Is it possible to program the AI?
« am: 19. Jul 2015, 02:30 »
Greetings, companions of the Edain!^^

I'm working on a Cair Andros map for the Map Pack that me and hoho96 are making, but I'm having some troubles. I created a simple script at the beginning, which assigns the starting units to Player_1 if this is created (which means if there's a player inside the fortress)
However, I also wished to create a unique feature, which is this: if the attackers want to challenge a friend, or they prefer an aggressive playstyle, they just need to put an enemy inside the fortress. The script was meant to assign the starting units and buildings to a neutral force, which acts defensively, if there are no players placed inside the fortress

This is the code I made:
*** IF ***
Player_1 has been created
*** THEN ***
Control of Team PlyrCivilian/Player_1_Inherit is transferred to Player_1
*** ELSE ***
Control of Team PlyrCivilian/Player_1_Inherit is transferred to PlyrGondor

This is, however, where I'm getting troubles. In fact, the troops are correctly transferred to Player_1 if this exist, but if there's no player inside the fortress, the troops aren't transferred to PlyrGondor and remain under control of PlyrCivilian, which, having no AI, it simply stands still. Why am I getting this problem? What am I mistaking?