Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Junk Yard Dog Question
Junk Yard Dog Question
Feb 2 2013, 8:11 am
By: Wormer  

Feb 2 2013, 8:11 am Wormer Post #1



Hello, guys! Here is a quick question.

Is it possible to give a unit (from player to player) so that it won't stop to perform the Junk Yard Dog script? Is there a flag (in a unit structure) that makes the unit remember he is performing JYD or is it handled the other way?



Some.

Feb 2 2013, 8:22 am TF- Post #2

🤙🏾

If you can give the unit then you can just run the script again in the same trigger? You can use a very small location to move on to the unit so no others will get Junk Yard Dog.



🤙🏾

Feb 2 2013, 8:34 am Wormer Post #3



Thanks, TF-, but I'm not looking for workarounds, because the target player can't execute triggers (and Run AI Script affects only the current player).

EDIT:
I was thinking if there is a flag in a unit structure that is being reset during give then probably disabling the unit or doing the other obscenity might do what I want.

Post has been edited 1 time(s), last time on Feb 2 2013, 8:40 am by Wormer.



Some.

Feb 2 2013, 9:42 am Leeroy_Jenkins Post #4



Quote from Wormer
Thanks, TF-, but I'm not looking for workarounds, because the target player can't execute triggers (and Run AI Script affects only the current player).

EDIT:
I was thinking if there is a flag in a unit structure that is being reset during give then probably disabling the unit or doing the other obscenity might do what I want.

I highly doubt it. But that's as far as I know.



None.

Feb 2 2013, 10:14 am O)FaRTy1billion[MM] Post #5

👻 👾 👽 💪

JYD is just an order, and giving a unit makes it stop it's current order. If you can find another way to set the order byte in the unit structure you could potentially do this.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Feb 2 2013, 11:11 am Wormer Post #6



Quote from O)FaRTy1billion[MM]
JYD is just an order, and giving a unit makes it stop it's current order. If you can find another way to set the order byte in the unit structure you could potentially do this.

Look at the following trigger:
Quote
Trigger("Player 2"){
Conditions:
Always();
Actions:
Run AI Script At Location("JYDg", "Anywhere");
Wait(0);
Give Units to Player("Player 2", "Player 3", "Terran Marine", All, "Anywhere");
}

What happens is that Marine moves to a random point and then stops. Give doesn't stop the order once the unit have started the movement, but unfortunatelly the unit doesn't repeat the JYD at destination point. This makes me wonder what makes a unit under JYD to repeat it's movement order once it reached the point?



Some.

Feb 2 2013, 2:46 pm Biophysicist Post #7



Interesting, but sadly there is no known flag that would do it, according to everything I know about the unit struct. Why can't the target player run AI scripts?



None.

Feb 2 2013, 3:51 pm Azrael Post #8



He might want P9-12 to JYD.

I can't say it's impossible, although I don't believe it can be done the way you want to do it with currently known information. If you figure out a way to apply a script to a player that can't run scripts, be sure to share it :P

As for two potential alternatives:

1) Make a system that simulates JYD without actually using it.

2) Detect when the unit stops moving, give it to a player that can run scripts, order it to JYD, then give it back to the original player.

Neither of these would be terribly difficult to implement, especially if you used units that LIDs work on.




Feb 2 2013, 5:02 pm Dem0n Post #9

ᕕ( ᐛ )ᕗ

Quote from Azrael
1) Make a system that simulates JYD without actually using it.
In a map that Heiner and I made, I think we had observers that were owned by a computer player JYD forever, and then had units owned by different players follow the observers around. It caused everyone to move around quite stupidly. You could try something like that.




Feb 2 2013, 9:07 pm Wormer Post #10



Thanks for the answers!

The target player can't run AI scripts (and triggers overall) because it's a human player that doesn't present in the game. Recently I've been working on an old project of mine (Galaxia) that has 8 human player slots. I wanted to make NPC defences to return fire without sacraficing a human slot. Since games usually doesn't gather a full house I had an idea to reuse a human player for that purpose. I was thinking about spawning NPC ships that fly around, but encountered the described JYD problem.

I don't think there is really a good solution for that problem, or a way to run scripts for players that can't execute triggers. I just opened the discussion in case I missed a simple and obvious solution (you know I often tend to overcomplicate things).

Of course I could try to manually implement random movement between planets in that map, but I don't think it's worth the effort. At this stage at least, since I'm working for my own pleasure mostly. But if you're feeling interested, we can discuss a method of random (or not so random) NPC ships movement implementation in that map's thread.



Some.

Feb 2 2013, 11:15 pm O)FaRTy1billion[MM] Post #11

👻 👾 👽 💪

Quote from Wormer
Quote from O)FaRTy1billion[MM]
JYD is just an order, and giving a unit makes it stop it's current order. If you can find another way to set the order byte in the unit structure you could potentially do this.

Look at the following trigger:
Quote
Trigger("Player 2"){
Conditions:
Always();
Actions:
Run AI Script At Location("JYDg", "Anywhere");
Wait(0);
Give Units to Player("Player 2", "Player 3", "Terran Marine", All, "Anywhere");
}

What happens is that Marine moves to a random point and then stops. Give doesn't stop the order once the unit have started the movement, but unfortunatelly the unit doesn't repeat the JYD at destination point. This makes me wonder what makes a unit under JYD to repeat it's movement order once it reached the point?
It doesn't stop immediately. It just stops the order. Like patrol: if you put a unit on patrol then give it, it will move to it's current waypoint then stop.

EDIT:
I was looking in to it a bit, and I don't really know how orders work. :P When I edit the unit's oder to 187 (Junk Yard Dog) it stays like that (with order states 0 = stopped, 1 = moving), but when it encounters an enemy it switches to order 10 (attack unit), then when it is no longer attacking that unit it switches back to 187. Somewhere it has to be saving that it is still JYD-ing. If I set the order to stop while it's attacking, it re-acquires the target and will still JYD. If I change the JYD order from 187 to anything (even 10), it will stop the JYD. There is a dwStatus flag, 0x8000000, that is set when it gets order 10 only when JYD-ing, but if I set that flag when normally targetting a unit it will not go back to JYD. So the only way to figure this one out, I think, would be to look at the disassembly of the JYD order. :P

Post has been edited 1 time(s), last time on Feb 3 2013, 12:18 am by FaRTy1billion.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are some real members mixed in those latter pages, but the *vast* majority are spam accounts
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are almost 3k pages
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- the real members stop around page 250
[2024-4-14. : 9:20 pm]
O)FaRTy1billion[MM] -- look at the members list
[2024-4-12. : 12:52 pm]
Oh_Man -- da real donwano
da real donwano shouted: This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
it's pretty common
[2024-4-11. : 9:53 pm]
da real donwano -- This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
[2024-4-11. : 4:18 pm]
IlyaSnopchenko -- still better than "Pakistani hookers in Sharjah" that I've seen advertised in another forum
[2024-4-11. : 4:07 pm]
Ultraviolet -- These guys are hella persistent
[2024-4-11. : 3:29 pm]
Vrael -- You know, the outdoors is overrated. Got any indoor gym and fitness equipment?
[2024-4-10. : 8:11 am]
Sylph-Of-Space -- Hello!
Please log in to shout.


Members Online: jun3hong