| 03-22-2005, 12:59 PM | #1 |
Is there any way at all that you can trigger a sfx to show for just one player? I really doubt it, but it would make some things in my map look much cooler. |
| 03-22-2005, 02:51 PM | #2 |
Code:
function AddSpecialEffectForPlayer takes player p, string path, real x, real y returns effect
if (GetLocalPlayer()!=p) then
set path=""
endif
return AddSpecialEffect(path,x,y)
endfunction |
| 03-22-2005, 08:54 PM | #3 | |
Quote:
open up trigger editor, click on the map name and put the above code in there. Then in your trigger, do a custom script: call AddSpecialEffectForPlayer(whatever player u want, "Path with instead of 1 \, 2 times \ (so doodads\tree.mdx will become doodads\\tree.mdx)", x,y) to make things easier, using a point variable (I think its easier :P) : Code:
function AddSpecialEffectForPlayerLoc takes player p, string path, location where returns effect
if (GetLocalPlayer()!=p) then
set path=""
endif
return AddSpecialEffect(path,GetLocationX(where),GetLocationY(where))
endfunctionjust make sure u clean up the location afterwards using RemoveLocation(), read the memory leak tutorial if u dont know what im talking about. |
| 03-22-2005, 09:46 PM | #4 |
Right on, thanks. I figured adding a special effect for only 1 player would desync. |
| 03-22-2005, 09:58 PM | #5 |
cool, so the function returning (essentially) null for some players won't desync it? right on, opens up a world of coolness uh, what about keeping track of the special effects for later though? is it possible to assign these local special effects to a global variable for destruction later on? |
| 03-23-2005, 07:25 AM | #6 |
sure, all this does is create a special effect without a model for other players, so it does create a special effect, u just cant see it. |
