Aller au contenu

Photo

redirecting to a custom chargen_sys script


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i can't get this to work. is there some really simple thing you can do to make this happen, for example like replacing the module_core with a replacement script and then call the chargen_sys replacement script from that. (i've tried that and i can't get it to work)

#2
Magic

Magic
  • Members
  • 187 messages
File > Manage Modules > Properties > Script



Here you can assign a custom module script without event redirection. As for redirecting events, I think there are add-ons which can help you with that.

#3
Sunjammer

Sunjammer
  • Members
  • 926 messages
The module_core script calls the standard sys_chargen script so unless you've overwritten it (not wise) your custom module event script will have to handle all the CharGen/level up events and prevent them from falling through to module_core either by setting nEventHandled to TRUE or by completely omitting the standard fall through code:
    if(!nEventHandled)
    {
        HandleEvent(evCurrent, RESOURCE_SCRIPT_MODULE_CORE);
    }

Modifié par Sunjammer, 06 avril 2010 - 09:25 .


#4
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
the problem i had was that the module core replacement script in the add class tutorial doesn't contain PreloadCharGen(); //preloads resources for character generation

StartCharGen(GetHero(),0,TRUE); //initiates character generation

so no event was sent to my script. now it works.