Jump to content

pan

Community Contributors
  • Content Count

    355
  • Joined

  • Last visited

  • Days Won

    13

Everything posted by pan

  1. As everybody seems to hate Allman's and most scripts already follow this standard ): I agree. I think 80 characters per line is a good limit see this answer: http://stackoverflow.com/a/578318/929395 @Haru I think when folding it can make a little more difficult, but when everything is unfolded it just seems better, but that's just my opinion. That's why standards need to be polled before being implemented, some things are "more personal" than others
  2. pan

    [solved]Atributos

    Você sabe qual o limite de alteração de stats? @MuriloStrike Como que está o seu PACKETVER? E qual o hexed que você está usando?
  3. That's why we need to show pros and cons and then make a poll to know which one is most accepted, I'm already using K&R in our source code, I don't mind switching styles in different projects, I just mentioned Allman's identation because nobody ever mentions it, and I, personally, find it better to read and to write than other styles. We can always change our scripting engine to make comply with other standards, that's not really an issue... But I see that it could be a waste of time. I always thought that our headers are not very good, but changing such a 'basic' thing would make a lot of people confuse :x
  4. pan

    [solved]Atributos

    Se bem me lembro, pelo menos nos clientes pré-renovação havia um limite imposto no próprio hexed, e só com um tipo especial chamado XRay era possível burlar esse limite. Provavelmente deve haver alguma limitação nos novos clientes que estão saindo também.
  5. Well, we can think of something, I'll try to study our current parsing engine and see what can be done c: It "separates" a block from the rest of the code, and also I think it makes easier to identify quickly different parts of the code, as it becomes less crowded.
  6. In some (very few) cases it's necessary to use it, so it needs to be kept in the documentation (perhaps also noting that it is deprecated and it should not be used unless strictly necessary.) An example where it is necessary is when you want to set a variable from another npc: set getvariableofnpc(.foo, "My Other NPC"), 1; Why not rewrite getvariableofnpc to behave like an identifier and work just like a regular variable would?getvariableofnpc(.foo, "My Other NPC") = 1;I prefer Allman's because it 'highlights' each block, making it easier to read, I also think that when functions are too crowded they are harder to read, but it's just a personal preference.
  7. I don't know why nobody ever says anything about using Allman style, in my opinion it's the easiest to read and to maintain. if (condition){}else{}Or even a variation that I personally prefer to read:if( condition ){}else{}And also I think sometimes shorthanding is a good way to save time and still make good code, other times you could use the ternary operator... And why don't use set to define variables? If it's not all right to use this syntax we should "remove" it from our documentation and just leave the entry in our source to keep backwards-compatibility.
  8. I can't see why not to implement this in our script engine, but I'm not so sure of what are the real implications of such modification performance/resource-wise...
  9. Goodbye, have a great time IRL, thank you for all the help and all the time you've given to this community, you certainly made quite a difference to all of us. Take care
  10. As far as I'm aware of those branches are used for testing purposes, systems that are not yet done etc., except for 'rAthena' that's used for internal reference in commits.
  11. I did a quick research and found a tool that is used to generate dumps: http://support.microsoft.com/kb/241215 also: http://www.simba.com/resources/knowledge-base/other-information-articles/create-a-core-dump-for-debugging-on-windows It's not a definitive solution, but I'll try to read about dbghelp and see what I can do to help (:
  12. This script is not complete, it's missing an 'OnPcDieEvent' label and an 'OnPcKillEvent'...
  13. @Hadeszeus It should be working, by quick looking into the latest revision the only change that can 'mess' with this snippet is: SC_DECORATION_OF_MUSIC, SC__MAELSTROM, SC__CHAOS, SC_MAX, //Automatically updated max, used in for's to check we are within bounds.} sc_type;Just remember to add SC_IGNOREDISPELL before SC_MAX and update its const number SC_DECORATION_OF_MUSIC, SC__MAELSTROM, SC__CHAOS, SC_IGNOREDISPELL, SC_MAX, //Automatically updated max, used in for's to check we are within bounds.} sc_type;Now it should be 578
  14. Open your map/script.c and search for OnPCLoadMapEvent, you should find something like: eA@r15265struct Script_Config script_config = { 1, // warn_func_mismatch_argtypes 1, 65535, 2048, //warn_func_mismatch_paramnum/check_cmdcount/check_gotocount 0, INT_MAX, // input_min_value/input_max_value "OnPCDieEvent", //die_event_name "OnPCKillEvent", //kill_pc_event_name "OnNPCKillEvent", //kill_mob_event_name "OnPCLoginEvent", //login_event_name "OnPCLogoutEvent", //logout_event_name "OnPCLoadMapEvent", //loadmap_event_name "OnPCBaseLvUpEvent", //baselvup_event_name "OnPCJobLvUpEvent", //joblvup_event_name "OnTouch_", //ontouch_name (runs on first visible char to enter area, picks another char if the first char leaves) "OnTouch", //ontouch2_name (run whenever a char walks into the OnTouch area)};I don't know how it its in rA, but in Herc it is now: /* script_config base */ script->config.warn_func_mismatch_argtypes = 1; script->config.warn_func_mismatch_paramnum = 1; script->config.check_cmdcount = 65535; script->config.check_gotocount = 2048; script->config.input_min_value = 0; script->config.input_max_value = INT_MAX; script->config.die_event_name = "OnPCDieEvent"; script->config.kill_pc_event_name = "OnPCKillEvent"; script->config.kill_mob_event_name = "OnNPCKillEvent"; script->config.login_event_name = "OnPCLoginEvent"; script->config.logout_event_name = "OnPCLogoutEvent"; script->config.loadmap_event_name = "OnPCLoadMapEvent"; script->config.baselvup_event_name = "OnPCBaseLvUpEvent"; script->config.joblvup_event_name = "OnPCJobLvUpEvent"; script->config.ontouch_name = "OnTouch_";//ontouch_name (runs on first visible char to enter area, picks another char if the first char leaves) script->config.ontouch2_name = "OnTouch";//ontouch2_name (run whenever a char walks into the OnTouch area)
  15. It's pretty old I guess so it should work, but you need to check within your source code just to be sure.
  16. Can you send cost for adding this feature to pm There's no cost in adding features to Hercules, but it may take some time as I have to analyse our source-code first, and then test everything. Another issue to recall is multi-platform support. It'd have to be platform specific implementations for linux and windows, both of which have their own optimal solutions (linux has POSIX threads, pthread.h, and windows just has all the functionality within windows.h to create threads, though I believe there's a pthread for win32 out there, I've never used it). Boost also has its own thread library, but that's C++, at which point you might as well use C++11 standard if you had that option for the built-in threading. Though pan is right, the major issue is trying to figure out what you can really throw into threads safely. At the very least, it'd be interesting to see certain scripts be async. That is to say, if there are no global dependencies (only character variables being used in the script), then it might be totally feasible to handle processing in different threads. Imagine 1000 people using the refiner, and instead of each user blocking another (which isn't noticeable unless you have a high volume of players usually), each one runs asynchronously. Though there's also the overhead of thread creation to consider. Then there's also creating testbenches so you don't need 3000 players to test how well it worked. It's not that difficult to code a thread-implementation that supports both platform specific ones. The real issue is to design a system that is more resource efficient that the current one, also designing multi-threading in legacy code without breaking any functionality is more difficult than designing in green field projects. Implementing this in code wouldn't be so difficult as designing such system, that's why it's needed to research on the subject extensively before trying to do anything otherwise it'd be wasted work. When my next break begins I'll start looking possible ways to implement this system in our current design and post a project to other developers analyse.
  17. Can you send cost for adding this feature to pm There's no cost in adding features to Hercules, but it may take some time as I have to analyse our source-code first, and then test everything.
  18. For more information about this error see: http://herc.ws/board/topic/4390-make1-warning-file-configrenewalh-has-modification-time-58e04-s-in-the-future/ it's not something in Hercules, apparently it's some kind of issue with your NFS. Moved to Source Support
  19. To add multi-thread support in something that's already coded is a lot of trouble. I'll read on this subject and see the cost-benefit of adding this 'feature' in Hercules.
  20. I think this new feature will be pretty useful, we should add it. I'll just wait to see the feedback from the community first.
  21. pan

    [CELL RANGE]

    Even if it's just a minor edit it can help to solve other people problems... Also don't forget to maintain the original topic title
  22. Well I searched for a while and found: http://www.delorie.com/djgpp/v2faq/faq22_18.html
  23. I agree with XGear and Ind, it'd better if this was a plugin and not a built-in feature, it just seems more things to do maintenance and clutter our main code-base. Let's just wait what a high-up has to say about this...
  24. "'prompt' works almost the same as select, except that when a character clicks the Cancel button, this function will return 255 instead." You should use it with a switch as well, something like: switch(prompt("yes:no")){
  25. Everything should be fixed now, even the .@time variable c:http://pastebin.com/sAX7KazV EDIT: Script corrected, forgot to remove a 'setd' http://pastebin.com/nrXrGEbT
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.