1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] if GetLocalPlayer() == udg_Player then

Discussion in 'Triggers & Scripts' started by LittleBigApple, Mar 3, 2014.

  1. LittleBigApple

    LittleBigApple

    Joined:
    Jul 9, 2012
    Messages:
    140
    Resources:
    2
    Maps:
    2
    Resources:
    2
    if GetLocalPlayer() == udg_Player then - SOLVED

    Hi

    I want to create a spell which puts a targeted unit into a shadow realm for several seconds and causes units (creatures of the void) to spawn and attack him :)
    By learning about if "GetLocalPlayer() == udg_Player then" I was able to create a nice effect for the transferred target while he is in the shadow-dimension.

    But is it possible to hide all units for a single player with the custom script?

    I have made a trigger, but it doesn't work
    • Creatures of the Void Attack
      • Events
      • Conditions
      • Actions
        • Set PlayerDarkGreen = Player 11 (Dark Green)
        • Custom script: if GetLocalPlayer() == udg_PlayerDarkGreen then
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Matching unit)) Not equal to Player 11 (Dark Green))) and do (Actions)
          • Loop - Actions
            • Unit - Hide (Picked unit)
        • Unit - Unhide TouchOfTheShadowRealmTarget
        • Custom script: endif


    In my example i'm trying to hide all units for darkgreen (which is the owner of the spawns) so that they will not attack anything but the target.

    Thanks :)
     
    Last edited: Mar 5, 2014
  2. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    You can't use the "Hide" action with GetLocalPlayer(). When you "Hide" a unit with that action, it will essentially remove it from the game for ONLY that player, so for everyone else, that unit is still there (not hidden), and once it interacts with something, the player who executed the local Hide action will be desync'd.

    To achieve what you want, you would have to use an ability that makes units invisible, and create dummy units with True Sight for players that you want to be able to see certain units.

    For example:

    Every "shadow realm" unit has an invisible ability, and are hidden with "Unit - Hide (unit)".

    Once a player is put in the shadow realm, you "Unit - Unhide (unit)" the shadow monsters and give the player True Sight, so he can see the shadow monsters.

    You may also have to give the player's unit invisibility too, so that the other players can't see him (because he's in the shadow realm) and thus, give the shadow monsters True Sight so they can see the affected player.
     
  3. LittleBigApple

    LittleBigApple

    Joined:
    Jul 9, 2012
    Messages:
    140
    Resources:
    2
    Maps:
    2
    Resources:
    2
    By sending the targeted unit into the shadow world, i'm giving him Permenant Invisibility + True Sight so that no one else can see him. The shadow monsters also have permentant invisibility + True Sight so they can spot the targeted unit too. Therefore I cannot add invisibility to the units outside the shadow world because the monsters would still be able to see them :b

    But is there any other way to make the monsters only be able to attack the targeted unit? :)
     
  4. vypur85

    vypur85

    Joined:
    Jan 27, 2014
    Messages:
    158
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Been a long time since I used GetLocalPlayer. So these information may either be outdated or my mistake.

    As far as I know, GetLocalPlayer works if you change the unit size, fly height, and vertex colouring. To make your units not visible, you can try setting their fly height to a large value, or reduce their size to zero, or set their transparency to 100%. Or, you could do all three.

    Then again, the player can still possible select the unit and attack the unit (though a little hard). The HP bar should be hidden when the unit height is set to a large value.

    Then again, it's not too wise to mess around with this. Make sure you test it out on multiplayer despite what I've mentioned above.
     
  5. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,718
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    I dont think that is possible with GetLocalPlayer()

    As a work-around I would suggest something like this.
    Units owned by player X is moved a to a certain region on the map
    in that region you spawn those void units. When all void units are dead or after X seconds you move them back to their old position.
     
  6. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,477
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Trigger your own attack system for shadow world.
     
  7. LittleBigApple

    LittleBigApple

    Joined:
    Jul 9, 2012
    Messages:
    140
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Thank you all for the nice tips - it works perfectly now! :) Also added a klassifikation to the enemy targets and made so that the monsters could only attack that specifik klassifikation (ofc. removed it when it was over)!