Jump to content

Recommended Posts

Posted

I'd like to suggest moving the Message Of The Day to a script with OnPCLoginEvent instead of !svn/bc/16928/trunk/conf/motd.txt

suggestion: trunk/npc/scripts_athena.conf

// --------------------------- MOTD -----------------------------
npc: conf/motd.txt // so people will find the MOTD script in the same place it's always been

// or should we go keep all NPCs in the same folder?
npc: npc/motd.txt

motd.txt

-	script	rathena_MOTD	-1,{
OnPCLoginEvent:
if (getbattleflag("display_version"))
	dispbottom "SVN version: " + get_revision();
dispbottom "Welcome to rAthena SVN! Enjoy! Please report any bugs you find.";

// add your custom MOTD messages and other script commands here:

end;
}

Advantages:

+ easier for server owners to customize

+ not limited to just displaying a message

+ they can trigger ANY script commands (ex: a common one, atcommand "@main on";)

+ (?) encourages new users learning rAthena to put all OnPCLoginEvent triggers in one file, thus avoiding "Event queue full" errors

Disadvantages:

- performance? loading one more npc script

- might still cause "Event queue full" errors if they already have a bunch of separate scripts with OnPCLoginEvent..

+ solution: load our MOTD script first, since it will not have any script commands that pause script execution

  • Upvote 5
Posted

There another disavantage that I can see

what if I had done something like a cron :

conf/motd.txt < news_on_forum

In short an automatic script tthat would read news somewhere and put them in MOTD for me, (like dunno why not fetch the last svn log message and put it there, if you doing that well could have a nice display)

Anyway with an npc that would require more skills to automate, (either remplace to npctxt by sed and such or link it to an extern file wich npc can't do atm...)

For this massive disavantage I'd vote "No" but we may add it as an npc too, or found another way.

Posted

I think it is not a valid point.

IMO a better solution is, to pull the mesasage from SQL. I'm all for removing motd support and replacing it with a script. It is always better to get rid of redundant features. Futhermore scripts are much more flexible. The logging in is not a too frequent action, so I doubt it could become a performance bottleneck for any server.

Anyways I think the default value of the event queue is way to low.

Posted

There other way of doing my example I agree.

You could just dump the message put it in sql table wich is read by npc IG and even have your log commit display automagically without reloading the npc etc.. ok

Still right now the way I see it, is simply taking off a feature for medium+ user.

They already can do a NPC like that on their own and probably already did something like that. But reading a common file and display it to the game that probably less common. So in short you taking away something "dunno how to do" for something pretty basic.

Like if one day I wanna read another file for display at a certain hour/event whatever. Assuming I'm intermediate I can just look MOTD behaviour and reproduce for a new event. Advance won't care much they'll fread...

Still the global idea is good but im just nor in favor to pure remplacement.

To encourage OnPC... in a same file the best thing would be to limit it in source to a certain premade file.

Posted

I do not like to add all the events to one file. It doesn't feel structured enough for me. At leas at my server I rather increase the size of the event queue, than forcing unstructured layout of scripts. Of course it is just my personal preference, probably others think differently.

Posted

So the main point is to let user customize it easily and encourage users to learn more script commands that can use with OnPCLoginEvent, so why not just a custom MOTD.txt in /custom/ folder (Which is disabled in default). Maybe a /doc/sample if /custom/npc is not 'so-good'.

Posted

I should clarify - I didn't mean telling users to put every single OnPCLoginEvent in the same file; I meant combining ones that made sense. Ex: combine these 3 npcs into 1:

-	script	news1	-1,{
OnPCLoginEvent:
dispbottom "Welcome to <server name> RO! Have fun!";
end;
}
-	script	news2	-1,{
OnPCLoginEvent:
dispbottom "Reminder: WoE will start on Saturday Dec 1.";
dispbottom "WoE times are Sat 1pm - 2pm, Sunday 8am - 9am.";
dispbottom "Type @time to see the current server time."
end;
}
-	script	news3	-1,{
OnPCLoginEvent:
announce "New maps were added. Please patch your client!",bc_self|bc_blue;
end;
}

It is good for me but what about the @reloadmotd thingy? When you do @reloadmotd the motd is displayed again i think.

Yes you're right. With my suggestion @gmotd would probably be removed since the MOTD would not be restricted to text announcements anymore.

Posted

Couldn't we change it so if the MOTD is blank it just wouldn't show. That way if a user requires a more advanced MOTD they can disable the existing implementation still add their own thing using OnPCLoginEvent.

Having a script reference directly hardcoded into source feels very weird for me.

  • Upvote 1
Posted

Couldn't we change it so if the MOTD is blank it just wouldn't show. That way if a user requires a more advanced MOTD they can disable the existing implementation still add their own thing using OnPCLoginEvent.

Having a script reference directly hardcoded into source feels very weird for me.

the best idea :P

Posted

I like Brian's original post. If we had it set out as an NPC script then there's no difference, then if users don't want it they can comment out the npc: npc/motd.txt line. This may give users who are not quite so confident a little push in the right direction for modifying their MOTD instead of leaving it default or removing it completely.

  • Upvote 1
  • 1 month later...
Posted

I've always used a MOTD script and not the txt in the conf I find it far easier and more customized

@Toasterofdoom, I'm assuming if we implemented this we would remove and hardcore reference to the script.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...