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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. Units have been turned into heroes in our latest Icon Contest! Vote for the best icon set at the Icon Contest #18 Poll!
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. 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.

Multi Player Instancebility

Discussion in 'Triggers & Scripts' started by UgoUgo, Apr 7, 2013.

  1. UgoUgo

    UgoUgo

    Joined:
    Nov 27, 2012
    Messages:
    587
    Resources:
    48
    Models:
    23
    Icons:
    22
    Skins:
    2
    Maps:
    1
    Resources:
    48
    Hello guys, Im wondering if my trigger below is MPI.
    Triggers
    • CRoom Port 6 TOP
      • Events
        • Unit - A unit enters CloneRoomPort6TOP <gen>
      • Conditions
        • CRoomWarping[(Player number of (Owner of (Triggering unit)))] Equal to False
      • Actions
        • Set CRoomWarping[(Player number of (Owner of (Triggering unit)))] = True
        • Set CRoomPoint[(Player number of (Owner of (Triggering unit)))] = (Center of CloneRoomPort1BTM <gen>)
        • Set CRoomPoint2[(Player number of (Owner of (Triggering unit)))] = (Center of CRoom1EntBtm <gen>)
        • Set CRoomPoint3[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
        • Set CRoomPoint4[(Player number of (Owner of (Triggering unit)))] = (CRoomPoint3[(Player number of (Owner of (Triggering unit)))] offset by 600.00 towards 90.00 degrees)
        • Unit - Make (Triggering unit) Invulnerable
        • Unit - Turn collision for (Triggering unit) Off
        • Unit - Order (Triggering unit) to Move To CRoomPoint4[(Player number of (Owner of (Triggering unit)))]
        • Unit - Set (Triggering unit) movement speed to 300.00
        • Set CRoomFilter = 0.00
        • Custom script: if GetLocalPlayer() != GetOwningPlayer(GetTriggerUnit()) then
        • Set CRoomFilter = 100.00
        • Custom script: endif
        • Cinematic - Fade out over 0.70 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with CRoomFilter% transparency
        • Wait 1.00 seconds
        • Unit - Set (Triggering unit) movement speed to (Default movement speed of (Triggering unit))
        • Camera - Set the camera bounds for (Owner of (Triggering unit)) to CRoom1 <gen>
        • Unit - Move (Triggering unit) instantly to CRoomPoint[(Player number of (Owner of (Triggering unit)))]
        • Unit - Order (Triggering unit) to Move To CRoomPoint2[(Player number of (Owner of (Triggering unit)))]
        • Camera - Pan camera for (Owner of (Triggering unit)) to CRoomPoint[(Player number of (Owner of (Triggering unit)))] over 0.00 seconds
        • Set CRoomFilter = 0.00
        • Custom script: if GetLocalPlayer() != GetOwningPlayer(GetTriggerUnit()) then
        • Set CRoomFilter = 100.00
        • Custom script: endif
        • Cinematic - Fade in over 0.70 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with CRoomFilter% transparency
        • Camera - Lock camera target for (Owner of (Triggering unit)) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
        • Wait 0.30 seconds
        • Set CRoomWarping[(Player number of (Owner of (Triggering unit)))] = False
        • Unit - Turn collision for (Triggering unit) On
        • Unit - Make (Triggering unit) Vulnerable
        • Selection - Select (Triggering unit) for (Owner of (Triggering unit))
        • Custom script: call RemoveLocation(udg_CRoomPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        • Custom script: call RemoveLocation(udg_CRoomPoint2[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        • Custom script: call RemoveLocation(udg_CRoomPoint3[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        • Custom script: call RemoveLocation(udg_CRoomPoint4[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])


    Now there's only 1 unit per player; so I just have to make sure it works for everyone, not every unit.

    Basically, Im trying to create a warp system. You know, the ones you see in old games, where when you switch places, you can still see the character moving while the screen is fading out.
     
  2. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    it looks mpi to me cant see anything unless i missed it. not sure but y do u set a variable to 100 in the getlocalplayer block ? i think that may cause desyncs
     
  3. UgoUgo

    UgoUgo

    Joined:
    Nov 27, 2012
    Messages:
    587
    Resources:
    48
    Models:
    23
    Icons:
    22
    Skins:
    2
    Maps:
    1
    Resources:
    48
    I followed Purgeandfire's tutorial for the getlocalplayer, it looked odd to me at first but it seem to make sense as I read his elaboration. I tried some debugging, doesnt seem to desync. But I'll have to confirm it with multiplayer tests.
     
  4. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    ok it just doesnt seem needed to me when looking at how ur trigger works.
     
  5. UgoUgo

    UgoUgo

    Joined:
    Nov 27, 2012
    Messages:
    587
    Resources:
    48
    Models:
    23
    Icons:
    22
    Skins:
    2
    Maps:
    1
    Resources:
    48
    I need the black mask effect ONLY for the owner of unit whoever entered region, something like old ps games.
     
  6. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    ooo oops lol i didnt see that variable being used in the filter lol. gotta love being tired. i see what u mean now.
     
  7. Bannar

    Bannar

    Joined:
    Mar 19, 2008
    Messages:
    3,087
    Resources:
    20
    Spells:
    5
    Tutorials:
    1
    JASS:
    14
    Resources:
    20
    Improve the efficiency of your script with variables usage. You use multiple references to:
    - (Player number of (Owner of (Triggering unit)))
    - (Owner of (Triggering unit))
    - (Triggering unit)

    I suggest setting additional variables in following order:
    • Set unit = (Triggering unit)
    • Set player = (Owner of unit)
    • Set index = (Player number of player)


    Lets look at this fragment for example:
    • Wait 1.00 seconds
    • Unit - Set (Triggering unit) movement speed to (Default movement speed of (Triggering unit))


    Since your event speaks of unit entering region, if another unit triggers this event during the 1.00 period the reference to (Triggering unit) will now point at newest unit and data about previous one will be lost. You need to fix those issues for trigger to be MUI.
     
  8. UgoUgo

    UgoUgo

    Joined:
    Nov 27, 2012
    Messages:
    587
    Resources:
    48
    Models:
    23
    Icons:
    22
    Skins:
    2
    Maps:
    1
    Resources:
    48
    Huh, I thought Triggering Unit is a local variable? And I tested with 2 players entering the region with about 0 - 0.2 sec interval, seems to be working fine.
     
  9. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    Triggering unit is a local variable and it is still mui or mpi w waits.

    He also only wants it to be mpi. Setting the variables would be nice but u would lose mpi that way unless u make those variables local in the trigger but then u need to do more work. Although if this event happens a lot the efficiency gain might be worth the extra work.