Staredit Network > Forums > SC2 Assistance > Topic: Ai script
Ai script
Aug 10 2010, 8:58 am
By: Striker  

Aug 10 2010, 8:58 am Striker Post #1



I just wanted to know if there is an Ai similar to the junk yard dog from scmdraft that i can use in starcraft 2 editor?



None.

Aug 10 2010, 9:06 am Temp Post #2



No but there is a roam behaviour in the data editor



None.

Aug 10 2010, 9:37 am Devourer Post #3

Hello

And it is doable with triggers as well, I can help you there if wanted.



Please report errors in the Staredit.Network forum.

Aug 12 2010, 12:16 am Striker Post #4



Yeah help would be awesome, I tried the roam and thats not really what i wanted. I want the units to move all over the map.



None.

Aug 12 2010, 12:49 am Ghoustine Post #5



Hello Striker,
I think we should ask ourselves exactly what "Junk Yard Dog" did in Broodwar. The unit would move in a random direction a random distance then stop for a random amount of time. We can emulate this for units through triggers. Make sure to pick a random direction relative to the unit "wandering." We can easily get the XY coordinates of this unit; then we need to decide how many directions we wish to have. I recommend 8. Up, left, down, right, top right, top left, bottom right, bottom left. (I personally would do as many directions as I possibly could, maybe 32 or 64, because I am literally insane.)

Let me know if you would like some more help constructing these triggers.



None.

Aug 12 2010, 1:12 am Striker Post #6



Yeah I need some detailed look of what the trigger would look like.



None.

Aug 12 2010, 1:59 am Temp Post #7



Quote from Ghoustine
Hello Striker,
I think we should ask ourselves exactly what "Junk Yard Dog" did in Broodwar. The unit would move in a random direction a random distance then stop for a random amount of time. We can emulate this for units through triggers. Make sure to pick a random direction relative to the unit "wandering." We can easily get the XY coordinates of this unit; then we need to decide how many directions we wish to have. I recommend 8. Up, left, down, right, top right, top left, bottom right, bottom left. (I personally would do as many directions as I possibly could, maybe 32 or 64, because I am literally insane.)

Let me know if you would like some more help constructing these triggers.

That is pretty inefficient considering there is already a behaviour in the data editor to do this. You could even use triggers to apply the behaviour.



None.

Aug 12 2010, 2:03 am Striker Post #8



Except the roam is not what i want.



None.

Aug 12 2010, 3:57 am shmeeps Post #9



Something like this might work:

Code
Untitled Trigger 001
   Events
       Timer - Every 1.0 seconds of Game Time
   Local Variables
   Conditions
       (Marine Unit order at index 0) == ( Stop)
   Actions
       Unit - Order Unit to ( Attack targeting (Random point in (Entire map))) (Replace Existing Orders)


Theoretically, this should make it so every second, if the unit has no order (is given the stop command), then it should take a random point in the entire map and order the unit to attack to there. It's not the greatest, but it should work. (You could also create another trigger every certain amount of time to do the same thing, this just prevents the unit from standing still while waiting for a timed order.)



None.

Aug 12 2010, 6:08 am Striker Post #10



Would that work for multiple units that are created with another trigger?



None.

Aug 12 2010, 9:16 am Ahli Post #11

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from Striker
Would that work for multiple units that are created with another trigger?
You would need to add all units in a unit group and do that action when the unit has no orders and is inside the unit group.




Aug 12 2010, 5:31 pm shmeeps Post #12



Yeah, just like he said, whenever you create a unit, add it to a global unit group variable, and then just modify the trigger to cycle through the unit group and check each unit to see if it needs to be issued a new command.



None.

Aug 12 2010, 7:46 pm Temp Post #13



For anyone who wants to use the data editor wander behaviour to accomplish the exact same effect as above (so you do not need to run an extra periodic trigger, or you have many units needing the behaviour) here is how you do it.

Create a new behaviour called JunkYard and set the behaviour type to wander. Set the Stats - Range field to 500.

Two triggers, one to turn on the junk yard mode and one to turn it off for all units in a unit group.


Code
Turn On Junk Yard
  Events
  Local Variables
  Conditions
  Actions
      Unit Group - Pick each unit in UnitGroup and do (Actions)
          Actions
              Unit - Add 1 JunkYard to (Picked unit) from (Picked unit)



Code
Turn Off Junk Yard
  Events
  Local Variables
  Conditions
  Actions
      Unit Group - Pick each unit in UnitGroup and do (Actions)
          Actions
              Unit - Remove 1 JunkYard from (Picked unit)




None.

Aug 13 2010, 1:20 am Vincent Post #14



Striker I'm also making an ob dodge map.

I have the observer junkyard and unit death triggers up thanks to Devourer.

Terrain is a lot different from your map and a bit smaller to fit about the same size as obs lovely.

I came directly from the east dodging clan channel op obs-
;)

Feel free to add me on msn.



None.

Aug 13 2010, 3:40 am Striker Post #15



Haha nicee, yeah I'm from west how far are you from completing the map?



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:09 pm]
Ultraviolet -- let's fucking go on a madmen rage bruh
[10:01 pm]
Vrael -- Alright fucks its time for cake and violence
[2024-5-07. : 7:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
Please log in to shout.


Members Online: Roy