Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 11-13-2014, 12:55 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default SendAppearanceEffect Endlessly Looping

Yesterday I discovered SendAppearanceEffect , thought it was super cool (still do) and started thinking of all the things I could do with it. My idea was to create invisible, untargetable NPCs to add particle effects to certain areas of certain zones.

This looks awesome, but I've encountered a problem with it that hopefully is caused by the way I scripted this. The particle effect seems to endlessly loop, spawning itself over and over and over again until my nice looking particles become a jumbled mess of lag.

Included are some pictures to show what I mean, and also the script I am using to spawn the particle effects.






Code:
sub EVENT_SPAWN
{
$npc->SendAppearanceEffect(389);
}
}
Reply With Quote
  #2  
Old 11-13-2014, 01:21 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default

I solved this on my own, by coding it as such:

Code:
sub EVENT_SPAWN 
{
	quest::settimer("Effect", 1);
}

sub EVENT_TIMER 
{
	if($timer eq "Effect") 
	{
		$npc->SendAppearanceEffect(346);
		quest::stoptimer("Effect");
	}
}
Reply With Quote
  #3  
Old 11-13-2014, 01:30 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default

On second thought, this effect disappears when leaving the zone and then coming back. Is there any way to keep these particle effects from disappearing when someone leaves the zone?
Reply With Quote
  #4  
Old 11-13-2014, 03:40 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Here is a solution to your issue.

When Trevius originally got this packet working he made it so there was an option to send these to an individual client.

So, assuming that your particle is 'static' as in, you send it once it stays for the client, this is what you can do.

Initially, send your particle packet just like you are with the NPC as it is.

And then for clients that zone in, you will need to send the particle to them so that they get the static particle spawned on their screen as well, BUT you only want to send it to that specific client so that you don't have the overlapping particle mess appear on other clients.

Code:
Perl_croak(aTHX_ "Usage: Mob::SendAppearanceEffect(THIS, parm1, parm2, parm3, parm4, parm5, singleclient)");
So, how does this end up looking? You need to get a little fancy and control the NPC from the player script.

Something like this.

player.pl
Code:
sub EVENT_ENTERZONE{
	#::: Make sure your npc_id is your particle npc (Assuming it is unique and there arent multiple of the same NPC)
	$entity_list->GetNPCByNPCTypeID(npc_id)->SendAppearanceEffect(346, 0, 0, 0, 0, $client);
}
So to break down what I'm doing, I'm fetching the entity with the entity_list method which means I can then cast methods to it like if I was performing commands on it via the NPC's script.

Does that make sense?

Last edited by Akkadius; 11-13-2014 at 03:47 PM..
Reply With Quote
  #5  
Old 11-13-2014, 05:15 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default

Yes, Akka, that makes perfect sense. I am slowly but surely getting the hang of this stuff. Great learning experience! Thanks for your help, you rock.
Reply With Quote
  #6  
Old 11-13-2014, 05:49 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

That thing was starting to show signs of life...
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:53 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3