• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] Item spawn in deathmatch map + AI

Status
Not open for further replies.
Level 4
Joined
Apr 12, 2011
Messages
12
Hi, I'm beginning mapper so I have some problems, expecially with triggers.

I'm working on simple hero deathmatch map, and I have a little problem with item spawn trigger. I want this trigger to spawn items at regions every X seconds. The trigger work in loop:
region[1] -> remove item -> make new item -> move to region[2] and do the same.

But there is a problem, becouse sometimes items spawn in the middle of the map. I don't know why...

I won't add screens of the code, becouse I have polish language version of Warcraft, if you can help please download the map I'm adding to the post :)


And another problem I have. I'm completely not knowledgeable with AI programming... and PC players won't play this map (PC hero stand at the place of rebirth, and do nothing). If somebody can help me with doing an AI script for this map - I will be very thankfull!!
 

Attachments

  • (12)Space_Deathmatch_v1.0.w3x
    217.2 KB · Views: 88
Level 28
Joined
Jan 26, 2007
Messages
4,789
I hope you understand the triggers of the English editor then, because:

"Set H_region_count = (H_region_count + 1)" <-- that is useless.
You shouldn't use waits either, do it like this:

  • Actions
    • For each (Integer A) from 1 to 24, do (Actions)
      • Loop - Actions
        • Item - Pick every item in HEALTH_regions[(Integer A)] and do (Item - Remove (Picked item))
        • Set tempLoc = (Center of HEALTH_regions[(Integer A)])
        • Item - Create Health Potion at tempLoc
        • Custom script: call RemoveLocation(udg_tempLoc)
    • Wait 90.00 seconds
    • Trigger - Run (This trigger) (checking conditions)
where "tempLoc" is a point (location) variable.
The custom script should NOT be changed!
"Integer A" increases every time it loops automatically, so there is absolutely no need for a new variable.

Do this for all your triggers, test it and tell me whether it worked or not.
 
Level 4
Joined
Apr 12, 2011
Messages
12
It helped a lot but not at all, becouse the on the first spawn (after map initialization) all items spawn at the center of the map.. second spawn is in the regions that I've made for them, and third as well. Don't understand why.

And thank you very much for that advice with loops and (Integer A) - I didn't notice I can do that this simple way!


Also I still don't know how the hell can I "learn" PC Players to run/attack etc. I guess it's this "JASS" or sth, but it's real black magic for me, can anybody help with that? Or just advice me how to do that..
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
It helped a lot but not at all, becouse the on the first spawn (after map initialization) all items spawn at the center of the map.. second spawn is in the regions that I've made for them, and third as well. Don't understand why.

And thank you very much for that advice with loops and (Integer A) - I didn't notice I can do that this simple way!


Also I still don't know how the hell can I "learn" PC Players to run/attack etc. I guess it's this "JASS" or sth, but it's real black magic for me, can anybody help with that? Or just advice me how to do that..

The solution to the first is really simple:
1) Remove the lines "Trigger - run
  • " (which run the item spawn triggers).
  • 2) Add the event "Time - Elapsed game time is 0.00 seconds" to each item spawn-trigger.
  • It should work now.
  • The second one can be as complicated as you want: it can vary from an AI which basically attacks, uses spells and buys items to an AI that knows when to use which spell, can buy strategic items, knows when to run and when not etc.
  • The latter one is, obviously, hard to do. It doesn't require JASS though (but JASS is [i]always[/i] the better choice).
  • I'll try creating a basic AI, but may not actually finish it. Don't expect too much.
  • [b]Edit:[b/] in the meanwhile, I might redo some of your triggers... especially the "Set Hero Variables" will undergo some changes.
 
Level 4
Joined
Apr 12, 2011
Messages
12
Awww, now I see how much I don't know and must learn! Event "Time - Elapsed game time is 0.00 seconds" helped, and now it is working well, thank you v much!

I think it's a good idea to make some other heroes and place to choose in the beginning of game. I will work on it to improve this map. And I forgot about the winning condition for the game. I think I can make trigger that will allow for example Player 1 (Red) to choose winning condition (when the gameplay starts). I will try and then write how I've done it to check is that correct.

But then AI scripts will be even more complicated - I guess...?
 
Status
Not open for further replies.
Top