Aller au contenu

Photo

Unable to get character generation working in new module


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

#1
Ainiana

Ainiana
  • Members
  • 45 messages
Having already checked the Wiki guide to this, it revealed to enter...

PreloadCharGen();
StartCharGen(GetHero(),0);
Under EVENT_TYPE_MODULE_START

The wiki is not totally clear, or perhaps i have made an error,
Since my module had Module_Core as its default script i duplicated the script to Module_Core2 and set it accordingly as my default start up script in the module.
This script has EVENT_TYPE_MODULE_START already as an event called in the script so i figured  i would just add those two lines above... into the event statement and above the break;

Unfortunatly this is not compiling for me, and is giving me errors relayed to sys_traps_h.nss which is not even in the list of includes. (nor have i done anything to that script)

This is actually the first bit of scripting i have done in Dragon Age and thus no other scripts in my toolset beyond Module_Core2 are altered in any way (if that helps)

I have absolutely no idea what the problem really is :)

The section of Module_Core i changed is as follows (rest of the script is as the default script in toolset)

        case EVENT_TYPE_MODULE_START:
        {
            PreloadCharGen();

            StartCharGen(GetHero(),0);

            TrackModuleEvent(nEvent, OBJECT_SELF);

            TrackSendGameId(TRUE);

            break;
        }


Any help would be much appreciated

Modifié par Ainiana, 15 décembre 2009 - 02:28 .


#2
Taleroth

Taleroth
  • Members
  • 9 136 messages
What includes do you have?

It sounds like your problem might be there, because your error is related to a header file. Even if it's not a header you included, it might be a header included in one of your includes (if there are any).

Modifié par Taleroth, 15 décembre 2009 - 03:08 .


#3
stuntpope

stuntpope
  • Members
  • 112 messages
The sys_traps_h include script is included in placeables_h which is included in module_core. Not sure why it isn't compiling for you, but to simplify things, do the following:
You are better off just handling the events you want to change and passing the other events back to the core script to handle.
You should strip out everything other than the event you are trying to change. After you handle an event you can decide if you want to pass it on to module core or not. If you don't handle an event then you need to pass it on to module core.
Example:

#include "global_objects_h"
void main(){
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev); //extract event type from current event
    int nEventHandled = FALSE; //keep track of whether the event has been handled
    switch(nEvent){
        case EVENT_TYPE_MODULE_START:{
            // -----------------------------------------------------------------
            // Initiate character generation.
            // -----------------------------------------------------------------
            PreloadCharGen(); //preloads resources for character generation
            StartCharGen(GetHero(),0,TRUE); //initiates character generation
            break;
        }
    }
    if (!nEventHandled) { //If this event wasn't handled by this script, let the core script try
        HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
    }
}

Here I have passed the EVENT_TYPE_MODULE_START event on to the core script after doing what I need to do, but it probably wouldn't matter in this case since the only things the core script does for that event are related to Bioware internal telemetrics (I think). If you didn't want to pass it on to core then you would set nEventHandled = TRUE in the event handler. All other events get passed on to the core script.

#4
Ainiana

Ainiana
  • Members
  • 45 messages
This fixed the problem, thanks a lot :)

#5
Mysticyx

Mysticyx
  • Members
  • 8 messages
It worked for me, too. :)

#6
Mytey

Mytey
  • Members
  • 1 messages
Rockin' :)