stuck glitch
Oct 2 2014, 5:15 pm
By: FlameViper  

Oct 2 2014, 5:15 pm FlameViper Post #1



The unplaceable message usually occurs when a unit gets replaced by another unit and doesn't have enough space to do so. Most of the time happens in rpg maps when evolving the unit.

I have a player that can switch between units. He has to be able to move his first unit till the second one finds space to be placed, or it automatically creates space with the use of mobile grids, which I don't know if it'll place the unit on an unreachable high ground or not.

Any of you have the triggers for it?-



None.

Oct 2 2014, 5:40 pm Dem0n Post #2

ᕕ( ᐛ )ᕗ

One way to avoid the unit unplaceable error is to create the unit in an area where there is enough space, and then move it to the location of the player. As long as you're not trying to place like an ultralisk on a one-tile space, that should work.




Oct 2 2014, 8:15 pm FlameViper Post #3



I have a marine and a mutalisk, and the mutalisk will be going over water. I made the trigger to keep firing if it doesn't detect the marine at the destination so eventually when the mutalisk reaches solid ground then the marine will be moved to the mutalisk's location. But I didn't get triggers exactly right so it ends up with vice-versa glitches where the marine gets sent back and the mutalisk remains where it is.



None.

Oct 2 2014, 8:20 pm Roy Post #4

An artist's depiction of an Extended Unit Death

Setup: You have a location following your unit, named "Unit", and a location off in the corner of the map, named "NewUnit". When you create a unit for Player 9* at NewUnit, the system activates and it will swap the units as soon as it is able.

*Note that you can't create units for extended players directly; when I say "Create a unit for Player 9", I mean "Create a unit for a player and immediately give it to Player 9". Also, you don't have to use an extended player; I just used one in the event that you don't have an available computer player to use.

The system:

Attempt
Players

  • Player 1
  • Conditions

  • Player 9 brings at least 1 [men] to 'NewUnit'.
  • Actions

  • Move all [men] for Player 9 at 'NewUnit' to 'Unit'.
  • Preserve Trigger.

  • Success
    Players

  • Player 1
  • Conditions

  • Player 9 brings at least 1 [men] to 'Unit'.
  • Actions

  • Remove all [men] for Player 1 at 'Unit'.
  • Move all [men] for Player 9 at 'NewUnit' to 'Unit'.
  • Give all [men] owned by Player 9 at 'NewUnit' to Player 1.
  • Preserve Trigger.

  • Failure
    Players

  • Player 1
  • Conditions

  • Player 9 commands at least 1 [men].
  • Player 9 brings exactly 0 [men] to 'NewUnit'.
  • Actions

  • Move all [men] for Player 9 at 'Anywhere' to 'NewUnit'.
  • Preserve Trigger.


  • This is the lazy system of "Replace when there's room." I've attached an example map. I split out the triggers into three separate players simply for organizational purposes: these triggers can be owned by any player, but the order of the above three triggers is important.

    On the attached map, when you press a number between 1-6 on your keyboard, it will swap the current unit with a new one. Play around with it to see the system in action.

    1 = Terran Marine
    2 = Zerg Ultralisk
    3 = Protoss Archon
    4 = Zerg Zergling
    5 = Terran Ghost
    6 = Zerg Scourge

    Trigger Explanation:

    Player 1's triggers are how to initially start the swap (I imagine you already have one in place for your map) using EUD Key Press detection. You can ignore these.

    Player 2's triggers are the swap system illustrated above. This is the part you're interested in.

    Player 3's trigger is just some basic miscellaneous stuff (moving 'Unit' onto your unit, and preventing you from wandering into the restricted area of the map). You can ignore this.

    All Players' trigger is just a hyper trigger. You can ignore this.

    Attachments:
    SwapUnits.scx
    Hits: 2 Size: 45.19kb




    Oct 2 2014, 9:48 pm Vrael Post #5



    For whatever reason, the SC algorithm for finding an acceptable square to place a unit on if you use the "Move" action works much better if there is already a unit at the center pixel of the location you want to move to.

    It's a bit counter intuitive, you'd think you would want to remove the old unit first THEN place/move the new unit, but if you reverse the order your Error rate goes down significantly.

    So do as follows:

    Conditions:
    Hero Switch Activated!
    Actions:
    Create NewUnit at "Wide Open Location"
    Center Location labeled "Hero Current Location" on OldUnit owned by Current Player at Anywhere
    Move 1 NewUnit at "Wide Open Location" to "Hero Current Location"
    Move 1 OldUnit at "Hero Current Location" to "Holding Cell"

    The only downside is the new unit will appear next to the old unit instead of exactly in its place, and its still actually possible the unit won't actually move to the correct location if there isnt an available patch of ground.



    None.

    Oct 3 2014, 1:32 am Roy Post #6

    An artist's depiction of an Extended Unit Death

    Quote from Vrael
    The only downside is the new unit will appear next to the old unit instead of exactly in its place, and its still actually possible the unit won't actually move to the correct location if there isnt an available patch of ground.
    The simple solution to that is to move the newly created unit onto the location again after having moved/removed the old unit. In your example trigger, just add a "Move 1 NewUnit at 'Hero Current Location' to 'Hero Current Location'" to the action list. In fact, this is exactly what I do in the example triggers and map posted above.




    Oct 5 2014, 6:20 pm FlameViper Post #7



    What if you weren't creating units and instead had to keep a-hold of them in a storage? same if it was manual selection rather than euds. Also do those EUDs even work in multiplayer for a specific player only?



    None.

    Oct 6 2014, 12:03 am Roy Post #8

    An artist's depiction of an Extended Unit Death

    Key Press detection is local, and it will not work for multiplayer games. I just used it as an example.

    You can very easily adapt my triggers to swap the units without creating new ones. Just have a holding area and put the spare unit there, and then move the unit to NewUnit when you want to swap them. Instead of removing the first unit, just put it in the holding area. You could even use just the NewUnit location if you're creative with the player owner. Play around with it and see what works best for you.




    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [05:00 pm]
    lil-Inferno -- benis
    [10:41 am]
    v9bettel -- Nice
    [01:39 am]
    Ultraviolet -- no u elky skeleton guy, I'll use em better
    [10:50 pm]
    Vrael -- Ultraviolet
    Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
    hey cut it out I'm getting all the minerals
    [10:11 pm]
    Ultraviolet -- :P
    [10:11 pm]
    Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
    [2024-4-17. : 11:50 pm]
    O)FaRTy1billion[MM] -- nice, now i have more than enough
    [2024-4-17. : 11:49 pm]
    O)FaRTy1billion[MM] -- if i don't gamble them away first
    [2024-4-17. : 11:49 pm]
    O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
    [2024-4-17. : 3:26 am]
    O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
    Please log in to shout.


    Members Online: Ultraviolet