Making Effect World Side? (5165)

02/23/2010 07:03 -NewDawn-#1
How would I make this code world side so that the world can see the firework or whatever effect i'm doing?

Code:
if (Cmd[0] == "/effect")
                            {
                                Game.World.Effect = Cmd[1];
                                    foreach (Game.Character Player in Game.World.H_Chars.Values)
                                       try
                                    { 
                                        Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, Game.World.Effect));
                                    }
                                       catch { }
                            }
02/23/2010 10:15 Korvacs#2
That looks fine to me.

Although you might need Player.MyClient.FinshSend(); or whatever it is.
02/23/2010 15:17 ~Yuki~#3
Korvacs you dont need to as the source has a 10ms timer on it.

but yh it woulda decrease the delay

@newdawn

That code should just work
02/23/2010 15:26 -NewDawn-#4
Quote:
Originally Posted by ~Yuki~ View Post
Korvacs you dont need to as the source has a 10ms timer on it.

but yh it woulda decrease the delay

@newdawn

That code should just work
Well yah, the code does work, but it's client side. If it goes off, nobody else can see it. I want it so that if someone sets off I firework or gets married (or gets an effect as part of a quest even) everyone else can see it.

(Got to go to class- I'll respond in a bit)
02/23/2010 17:19 pro4never#5
Do a loop through clients who can see the player and display the same effect to them (except at the x/y of the person using it)
02/23/2010 18:26 Korvacs#6
Code:
                            if (Cmd[0] == "/effect")
                            {
                                Game.World.Effect = Cmd[1];
                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                                {
                                    Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, Game.World.Effect));
                                }
                            }
Hows this? I just removed the try catch and added brackets for the foreach.
02/23/2010 19:34 ~Yuki~#7
i woulda set it to PointDistance as i would not want ppl to see the effect if they arent in range / on other maps
02/24/2010 00:01 -NewDawn-#8
Quote:
Originally Posted by Korvacs View Post
Code:
                            if (Cmd[0] == "/effect")
                            {
                                Game.World.Effect = Cmd[1];
                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                                {
                                    Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, Game.World.Effect));
                                }
                            }
Hows this? I just removed the try catch and added brackets for the foreach.
Well, that does make it cleaner but it's still client sided.

Quote:
Originally Posted by pro4never View Post
Do a loop through clients who can see the player and display the same effect to them (except at the x/y of the person using it)
How would I do a loop that would do that?
If I created a loop, wouldn't it just do it for the client it's coming from?

Quote:
Originally Posted by ~Yuki~ View Post
i woulda set it to PointDistance as i would not want ppl to see the effect if they arent in range / on other maps
How would I do that? =\
Can someone give me an example? This effect command is just a simple code that I can test it on. I have so many ideas but I really need help... so if anyone has an idea... PM me or respond please.. =s
02/24/2010 00:14 Korvacs#9
What sort of effect is it, it seems that your trying to make one stay with a character as it moves around.

What you posted, and what i modified it to will send the effect to everyone, and it will only work for there clients.

I assumed this was fine because you said they were fireworks...
02/24/2010 03:13 -NewDawn-#10
Quote:
Originally Posted by Korvacs View Post
What sort of effect is it, it seems that your trying to make one stay with a character as it moves around.

What you posted, and what i modified it to will send the effect to everyone, and it will only work for there clients.

I assumed this was fine because you said they were fireworks...
Well that's the problem, it's not just fireworks...
here: [Only registered and activated users can see links. Click Here To Register...]
02/24/2010 03:14 Arcо#11
Since you have another thread about this I think one of them should be closed.
Gonna report it just so a moderator knows.