Need help with creating simple AI triggers/scripts :)

soider8

New Member
Reaction score
0
Okay so I've been editing this Map for ages! Really and honestly ages, and the one thing I struggle with.. is the AI part.
I think it's probably quite simple, but I'm really struggling.
So the map is called Battlefield, and originally does have AI working, using the AI editor, although I think I would just need to use the Trigger editor to do what I want.
It is relatively alike to castle fight, it's 5v5, you spawn with a builder, building's cost, units spawn repetitively which are then sent to the other side of the map, where the same thing is happening.. So it's pretty much a castle fight game.
Okay, so I've made a few changes to the map.. I wanted it to have a DotA feel to it, so I made default building's related to night elf's on the first team, and undead on the second. I changed the default builder, and made him into two sections, on which will spawn the Nelfs (Night Elfs) and create Nelf units, and the other for the other team to create specifically Undead units. If you're wondering I did balance the treants with ghouls, and blah blah.

So what I need help with is, it's quite simple really, I want the default builders, to randomly create building's in there own region (I'm sure I've set the regions okay too).
Now I've tried to do this with AI script's, which were used by default so I thought I only had to change a bit, and I've tried triggers, but the Bots (AI) just won't do as there told.

SIMPLE: Need to order all builders (Nature Builders) on one team to randomly create out of a choice of building's, this will be repeated continuously throughout, and all builders on the other team (Undead builder's) to do exactly the same thing, but of course creating different building's.

Btw I am quite experienced with the editor, and I will catch on quick to anyone that can provide advice.

I was also wondering if I could upload the map somehow for you guy's to look at it, but I might be breaking forum rules so I'll leave it as it is for now.

This is an image on how the defualt AI trigger is layed out.

1000p.png


I hope I'm allowed to do this, but here is the download link for anyone who really wants to help :D http://www.epicwar.com/maps/158180/
 

DioD

New Member
Reaction score
57
array with every possible building + timer + build order.

unit will fail order if does not have money, and this can be detected (not in gui)(issueorder return boolean)

if you cant use Jass by religion national or any other means you also will need database for cost for every building.
 

soider8

New Member
Reaction score
0
array with every possible building + timer + build order.

unit will fail order if does not have money, and this can be detected (not in gui)(issueorder return boolean)

if you cant use Jass by religion national or any other means you also will need database for cost for every building.

Thanks for the feedback, but I really need you to be more specific, as in what do you mean about 'array' and 'jass', sorry but these are all new to me.
 

HydraRancher

Truth begins in lies
Reaction score
197
An Array is where you store data in part of a variable. Such as TempInteger[ARRAY_NUMBER]. Therefore, you can set TempInteger[1] to equal 5, whilst TempInteger[2] equals 7.

JASS is the alternative to GUI. It is better at manipulating things but it is all done in written code.
 

soider8

New Member
Reaction score
0
An Array is where you store data in part of a variable. Such as TempInteger[ARRAY_NUMBER]. Therefore, you can set TempInteger[1] to equal 5, whilst TempInteger[2] equals 7.

JASS is the alternative to GUI. It is better at manipulating things but it is all done in written code.

Okay... do you think you could create an example trigger for me, to issue the builder to (randomly choose) and produce buildings of which are available in a certain region, that's all I'm really asking for if it's possible for it to work.
 

DioD

New Member
Reaction score
57
every 30 seconds of game time

set integer = GetRandomNumber(1,11)

if buildingcost[integer] > GetPlayerState(Who, STATE_GOLD) then
well this structure cannot be build now
else
call IssuePointOrder(Builder, X, Y, buildingid[integer])
endif

Also i dont know how you will detect position for buildings, this cannot be done from GUI.
 

soider8

New Member
Reaction score
0
every 30 seconds of game time

set integer = GetRandomNumber(1,11)

if buildingcost[integer] > GetPlayerState(Who, STATE_GOLD) then
well this structure cannot be build now
else
call IssuePointOrder(Builder, X, Y, buildingid[integer])
endif

Also i dont know how you will detect position for buildings, this cannot be done from GUI.

I'm sorry to be a pain again, but I can't seem to find which comparisons to use and when, and it isn't as clear, could you provide step by step instructions?
 

Happy

Well-Known Member
Reaction score
71
its an integer comparision...compares "cold cost of the building" (saved in a variable) and current gold of the player.
 

HydraRancher

Truth begins in lies
Reaction score
197
Also i dont know how you will detect position for buildings, this cannot be done from GUI.

What? Sorry I didn't understand that... (Position of (<Building>)) gets the position of the building...And (Random point in (<Region>)) would decide where to put it.
 

HydraRancher

Truth begins in lies
Reaction score
197
You COULD first check a 1 radius around the building point and check if there is something there, if there is, then re-random.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top