Flymode script, plugin
Yeah I am back again on this silly subject...But I am trying to make script this time. As I usually plagiarize all your folks outstanding works, for my own evil empire. This time I am attempting to actually script myself (well, sorta...)
I need help/push in the right direction. Searches so far in the past two days... Flymode,$npc,$mob,setflymode,set *** Done so far *** I am using a in-game macro to set the NPC(Mob) flymode=0. This (for me) enables myself to hear the walking sounds of mobs nearby. Now I am trying to do this automated through a script (script is below). *** Concerns *** 1. Since the macro is a clicky, it is dependent on my interaction with the NPC. Which is "meh", it works, but I am concerned about the effect it might have on the NPC(see number 2) as I leave its area of influence. 2. I am concerned with scripting issues and so forth with everything tied to a flymode=3. *** Intention*** 1. I am trying to use a script that will fire...to change the NPC(Mob)'s Flymode=0, when entering a $client range...and set it back to Flymode=3 when leaving. 2. I plan to make this a plugin and then call on it in the Global_player.pl. 3. It will have exception list for water mobs and such eventually. 4. Maybe figure out to make a in-game toggle command, just in case I come across a weird issue. 5. Will place it all in a quest::timer. *** CURRENT ISSUE *** I am having the worst brainfog on what to do, to get a mob's flymode to change. I can do it with a in-game command. And it seems looking at the Perl Reference list I can do this in a script. Of course unless I can get the script below to work, it is no use to go any further. All my attempts that do not (seem) work have been #commented out but left to reference on failures. Any suggestions? (Placed in a global_npc.pl. for testing) sub EVENT_SAY # Testing only for now...later this will be in a check_distance on a timer...etc. { if($text=~/hail/i) { quest::say("You have grounded me!"); # my $npc_target = $client->GetTarget(); # my $mob_target = $npc_target->GetID(); # quest::FlyMode(0); # $mob->SetFlyMode(uint8 flymode[0]) # $mob->SetFlyMode(0); # SetFlyMode(0); # $mob->SetFlyMode(uint8 flymode(0)); # $mob->SetFlyMode(uint8 flymode() = 0); # $npc->SetFlyMode(0); # my->SetFlyMode(0); # $npc_target->SetFlyMode(0); # $npc_target->SetFlyMode(flymode 0); # $npc->SetFlyMode(flymode 0); # SetFlyMode(0); } } Thank you in advance!! -Eric |
This works real simple for setting it globally. I could hear all mobs walking anywhere. (using RoF2) BUT, it would need to be built on (in some way) to prevent the water mobs from being included.
global_npc.pl Code:
sub EVENT_SPAWN { Code:
2005 |
Quote:
|
Quote:
|
Code:
Thank you. And thank you for the underwater npc listing. That must have been a mess to figure out. Very awesome. Question...have you had any issues with Flymode=0 ? The NPCs acting proper to your deity like demands? -Eric |
That list was easy enough, with Navicat and Notepad++, the sorting features on those, it only takes a matter of minutes and a few clicks to generate the list. I haven't done any further testing with that flymode 0 thing, so I don't know if there is other issues with it.
|
I need to look into the Notepad++.
Another question for anyone willing... It seems that some commands or whatnots do not work in the "EVENT_SAY". Such as my issue with the "flymode=0". Works perfect in the "EVENT_SPAWN". I had come across another post (tried to find it yesterday) where it was a similar issue and was fix when the individual move it out of the "EVENT_SAY". Any thoughts as to why that may be? I always like testing my scripts with the "EVENT_SAY" before moving them to other EVENTS. But now I am thinking some of my failures could have maybe worked in the past if I used a different technique. CHEERS!! -Eric |
Paste an example of what you are trying to do in EVENT_SAY and have issues with.
Also, don't forget to run perl -c your_script.pl from a command prompt for a quick syntax check. |
cOncrete, thank you for replying.
As far as issues with EVENT_SAY, up until now (code below) I had been able to cannibalize scripts and debug/test them on the fly with EVENT_SAY in game. I wish I could find that other individuals post, but I was really tired when I came across it, and didn't save for later use as a personal help file. Kicking myself for that, it was a "AHA!" moment, but now I do not remember why. Ugh. This code did not work...but...read further. Code:
(Placed in a global_npc.pl. for testing) "run perl -c your_script.pl from a command prompt" I need to re-attack that and learn the knowledge of how to perform the command. In the past I had the same issue with trying to run the "eqemu_server.pl". I gave up and made a batch file that does it for me. There is some part of my brain that just cannot get this right. And I do not know why. Half of doing CMD stuff eludes me. I do use Visual 2017, it seems to catch a lot of my mistakes. But, again I need to try to learn what you suggested. Posting again with what I have so far with this ittybitty script. -Eric |
Ok, so far this is what I have done...
More post searches so far...Array,Hash,!=,ne,comparison,IF,FOREACH Been reading and trying many different ideas all day. ***Done so far*** With Huppy chiming in and graciously handing me what I now call "Swimmers" list. :grin: I have been able to make the spawns set their Flymode=0. So now what I am trying to do is make it that when the NPCs spawn in, they check against the Swimmers. If they swim they do nothing, if the NPC is a landlubber then set the Flymode=0. So far they either all change their mode or none at all. I cannot grasp the array language. Well ok strike "cannot"....I am so far learning how to not be successful with arrays. That is good info too, right? global_npc.pl Code:
sub EVENT_SPAWN So when everyone is "Flymode=0" swimmers included. I have witnessed in two different zones that the swimmers still swim. BUT! When the move about, attack/chase...they do not do so fluidly. I watch them in a timely manner, depending on walking or running/chasing...skip or pop forward on their path. Or in other words, they tend to disappear and reappear every few in game feet. As apposed to watching them swim. They do however, float/swim around and not fall to the in game floor and walk. CHEERS! -Eric |
your token on Swimmers needs to be a @ (for an array), not a $ (for a scalar).
|
I have no clue as to why my last post elongated so bad. Just in case it was the script I change the look a bit.
So I applied the change of a "@". I think I had done that before in one of my many iterations in trying the different lines. But it is in there, still the swimmers do not stay in Flymode=3. I will keep searching the forums and such, but I am beginning to think I might have to find how to do this another way. Here is a clean version of my attempt... Code:
-Eric |
you're using the wrong operator. use ~~ to test if a value is in an array (!~ for inverse).
using code blocks with long lines (like your @Swimmers definition) on the forums is what causes the width issue with the post. |
Quote:
Code:
sub EVENT_SPAWN { |
Operators get me every time. I am trying to grasp them though, have cheat sheets and keep rereading website info. Thank you.
I am gonna call this script solved and it is posted below for the future folks. If anyone does come up with a better solution or wishes to expand this script to new levels PLEASE do so. I love improvements. Thank you Huppy and cConcrete! It is hard to explain how very important this subject is to me. Makes a world of difference when I play. Code:
#////////////////////////////////////////////////////////////////////////////// |
All times are GMT -4. The time now is 12:36 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.