hl_world
  • hl_world
  • 54.5% (Neutral)
  • Private Topic Starter
17 years ago
OK, here's the deal. I'm making a singleplayer map to experiment and try to get AI to work. It's for the ShockWave mod but I have basic questions as well.

About the map:
There are 2 AI players (Armor and vGLA) I'm trying to get to have a decent battle between them. I watch as a 3rd vUSA player out of the way of attack with the map permanently unshrouded. Anyway I'm trying to get the Ironside player to show some common sense.

  • When getting him to build vaporiser cannons, it seems only possible to do this by having module bunkers in his build list, name them and for them to trigger a [S A nD] script:
  • *** IF ***
    	True.
    *** THEN ***
       Unit '<This Object>' use Ability 'Armor_Command_ConstructAmericaVulcanTurret_Dummy'.
    but doing this seems to make the AI build several module bunkers > vaporiser turrets in the same place, sometimes overlapping, as the ones on the build list thus hogging all of his power output. How do I make him stick only to the build list?
  • He doesn't rebuild his command center despite setting rebuilds to unlimited. What's up with that?
  • How do I get him to build 2 supply trucks and maintain that number? I've tried teams but the 2nd truck doesn't bother gathering supplies.


Also:
  • Do [S A nd] scripts run, check it's conditions and perform actions when the map loads or does the subroutine flag lock it until it's referenced?
  • What about [S A D] scripts? Does the fact that it deactivates after it has run mean it won't run when triggered by another script?
  • As for [S nA D]. Does it not run when triggered by another script because it's set to inactive?
Thanks in advance.
Sponsor
Drummin
17 years ago
I haven't worked with that Mod but just looking at the script you posted, the script is repeating constantly. I'd make a build condition or add a counter to control this event.

I've found that subroutines are only useful for calling on spawning a custom team. They really don't change the behavior of the script itself.

I would probably make one script to check a condition as in
*** IF ***
Player '' has Less Than 2 unit or structure of type 'WhateverUnitType'
*** THEN ***
Enable Script 'CannonScript'.

I'd then have your Cannon script say [ns na D] and use the *** if *** True line.
Me Myself and Pi
17 years ago
Scripts checked as subroutines can be run by teams & also by other scripts. When a team or script runs it, the actions will then be carried out when the condition is met.

When a script is not active, it can be enabled again by another script.

When a script is disabled upon success, that means that when it's condition is met, it becomes disabled & can also be enabled again by another script.
hl_world
  • hl_world
  • 54.5% (Neutral)
  • Private Topic Starter
17 years ago
Thanks. So what would you suggest I do with the vaporiser turrets?
Drummin
17 years ago
Have you tried your current scripting setup with the [S na D] setting, having your build list trigger your vaporiser script? I'm sure Me Myself And Pi will have some answers for you.
Me Myself and Pi
17 years ago
I'm alittle confused on how this is set up. Does the AI player build this vaperisor turret as an upgrade for a specific unit? If so, you wouldn't think that you could multiple ones. Or is it a building? If so, then the action in your script Unit '' use Ability 'Armor_Command_ConstructAmericaVulcanTurret_Dummy' wouldn't make sence.

So just let me know how this all works.
hl_world
  • hl_world
  • 54.5% (Neutral)
  • Private Topic Starter
17 years ago
The concrete slab is a building which doesn't do anything on it's own. If you click it, you get the option of building 3 upgrades for it, 1 of which is the vaporiser turret. I think I know why the AI keeps building concrete slabs around their originals, correct me if I'm wrong here:
  • The first slab gets built under build list
  • 1st slab follows [S A nD] script " uses command ability [build vaporiser turret]"
  • 1st slab turns into vaporiser turret making the AI player 'lose' the concrete slab. Side note: concrete slab loses its name in build list settings
  • AI thinks 1st slab has been destroyed and so builds another on build list settings "rebuilds: unlimited"
  • 2nd slab gets built and process loops.
So the question is, how would I get the AI to only replace vaporiser turret with concrete slab if it gets destroyed?
Me Myself and Pi
17 years ago
After it's upgraded, is the object name changed too? It sounds like when the concrete slab is upgraded, it gets deleted & a new object spawns there. So then the script might be like this:

If concrete slab is destroyed
& player doesn't have vaporiser turret
or player has lost a Vaporiser tutter
Then Build another concrete slab.

Somthing like this might work.
hl_world
  • hl_world
  • 54.5% (Neutral)
  • Private Topic Starter
17 years ago

It sounds like when the concrete slab is upgraded, it gets deleted & a new object spawns there.


Thats my theory.

Thanks. I'll try that out.