• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Any way to show a special effect to a single player?

Status
Not open for further replies.
Level 8
Joined
Jul 17, 2004
Messages
283
Is there any way to show a special effect from triggers to a single player with GetLocalPlayer, or any other method?

Also, is there any way to create a quest for a single player as well?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Basically you are utilizing the GetLocalPlayer function to set the intended value inside the block, while setting the unintended value (0, null, etc) outside of the block.

When all variable is set, it will obey the variable separately for variable that is set outside and inside the block.

Only players that is inside the block can see the intended value while players outside the block sees nothing (depends on what you set).
 
Level 8
Joined
Jul 17, 2004
Messages
283
First of all, thank you, both of you.

Well, what I am trying to do is display an exclamation mark (special effect) over a quest giver when a quest is available to a specific player, and then remove it after you've talked to them, etc. So this will be at different times for all players. Let's say I've got 3 player slots for my game. Do I need to make an SFX variable per player, to store the data in? (Because I'll need to destroy an exclamation point per player?)
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
Do remember that all clients need all used strings loaded in the same order for the game to not desynchronize. This means that you should declare model file path strings in constant global variables at map initialization (which makes sure the string is loaded prior to use). You then use this global variable to reference the model for specific players and null/empty string for no model for all other players.
I would use an array with one effect per player. It may be possible to recreate the effect for more/less players but if it is animated users may notice an animation discontinuity.
 
Level 8
Joined
Jul 17, 2004
Messages
283
So how would you go about destroying the exclamation mark for only 1 player? I understand creating it, but what about destroying?

Edit: Well this is what I ended up doing. This worked fine, and didn't cause any desyncs between players. Thanks everyone for your help!

  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set All_Players = (All players)
    • Player Group - Pick every player in All_Players and do (Actions)
      • Loop - Actions
        • Custom script: if GetLocalPlayer() == GetEnumPlayer() then
        • Set String = Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
        • Custom script: else
        • Set String = <Empty String>
        • Custom script: endif
        • Special Effect - Create a special effect attached to the overhead of <Quest Giver> using String
        • Set SFX[(Player number of (Picked player))] = (Last created special effect)
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Talk
    • (Unit-type of (Target unit of ability being cast)) Equal to <Quest Giver>
  • Actions
    • Game - Display to (Player group((Owner of (Triggering unit)))) for 1.00 seconds the text: <Message>
    • Special Effect - Destroy SFX[(Player number of (Owner of (Triggering unit)))]
 
Status
Not open for further replies.
Top