Aller au contenu

Photo

Character Generation


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

#1
rafterman23

rafterman23
  • Members
  • 9 messages
Guys i am a complete newb to scripting, and i really don't want a 30 minute lesson on every single intricacy of scripting and its uses, i really (for now) just need to set up character creation at the beginning of my module.
The script i have right now is really weird. When i first enter my module, character creation comes up, but the models on the left are completely black, and never change. Its always the default "Jaden" character who has no class and such, even if i set it to female dwarf rogue or something like that. It doesn't change, and is all messed up.
Here is the script (i dunno if there is some special way to put it in the forum....)

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    string sDebug;
    object oPC = GetHero();
    object oParty = GetParty(oPC);
    int nEventHandled = FALSE;

    switch (nEventType)
    {
        case EVENT_TYPE_MODULE_START:
            {
            PreloadCharGen();
            StartCharGen(GetHero(),0);
            }
    }
}

So what is going wrong here?

#2
CID-78

CID-78
  • Members
  • 1 124 messages
that is because your script doesn't handle the chargen events. you must let all events you don't want to handle to continue into module_core.ncs. so the default code will deal with them.

#3
rafterman23

rafterman23
  • Members
  • 9 messages
i literally have no idea what you just said. "Chargen events = ?" "all events i don't want to handle to continue....?" to where? and what the heck is "module_core.ncs"? Default code?



what?

#4
CID-78

CID-78
  • Members
  • 1 124 messages
each button and step in the chargen cause a event to happen just like the one you use to start it: EVENT_TYPE_MODULE_START. either you write your own code that handle them ie write your own chargen or you must pass all unhandled events into "module_core.ncs" ie the default script for all module events. which will call sys_chargen.ncs and run all the necissary code for dragonage standard chargen.



the wiki contains the script you need for this, it also contain a few alternatives.



this setup makes the chargen very flexible even if it still has a few limitations.



your problem is that you don't have any event code that handle the button click which obviously mean nothing happens when you press the buttons.

#5
rafterman23

rafterman23
  • Members
  • 9 messages
i now have this script in place. It makes all the changes, and does everything that character generation is supposed to do, yet the models and the background IN the character gen are still all black and i can barely see a thing.

#include "events_h"
#include "global_objects_h"

void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev); //extract event type from current event
int nEventHandled = FALSE; //keep track of whether the event has been handled
switch(nEventType)
{
case EVENT_TYPE_MODULE_START:
{
PreloadCharGen(); //preloads resources needed for character generation
StartCharGen(GetHero(),0); //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);
}
}

Is there still a problem?

i should probably also note that if i start a new game in the normal DA:O campaign, the character creation looks fine and works fine. So i don't know if its still a script problem, or a game / models / video problem...

Modifié par rafterman23, 02 juin 2010 - 09:06 .


#6
eldav

eldav
  • Members
  • 378 messages
I wish Basic was still around.

#7
CID-78

CID-78
  • Members
  • 1 124 messages
that's because you start the chargen before the chargen area has been loaded. in The OC you got a area that contain both the chargen and the party selection. and if the game hasn't had time to load that area you will have a dark window where you barely can see the character.



you can modify the background this way. not sure if you can jump around the character during chargen to change background but in theory it should be possible.

#8
rafterman23

rafterman23
  • Members
  • 9 messages

CID-78 wrote...

that's because you start the chargen before the chargen area has been loaded. in The OC you got a area that contain both the chargen and the party selection. and if the game hasn't had time to load that area you will have a dark window where you barely can see the character.

you can modify the background this way. not sure if you can jump around the character during chargen to change background but in theory it should be possible.


Where is the solution here? i can modify the background in what way? i don't see an answer.

#9
CID-78

CID-78
  • Members
  • 1 124 messages
don't start up the chargen during the start of the module, instead wait until the player has entered the chargen area. so that preview contain a loaded area with valid lightmap.

#10
rafterman23

rafterman23
  • Members
  • 9 messages
there is an area for this? since i'm a complete newb at scripting, perhaps you could provide scripts to help me out here - because i don't know how i could load an area without a created character, or how that area is going to be used in chargen.

I'm still using the wiki's default chargen script here by the way.

#include "events_h"
#include "global_objects_h"
 
void main()
{
    // keep track of whether the event has been handled
    int nEventHandled = FALSE;
 
    event ev = GetCurrentEvent();
    switch(GetEventType(ev))
    {
         case EVENT_TYPE_MODULE_START:
         {
            // preloads resources needed for character generation
            PreloadCharGen();
 
            // initiates character generation
            StartCharGen(GetHero(),0);
 
            break;
         }
    }
 
    // if this event wasn't handled by this script fall through to the core script
    if(!nEventHandled)
    {
        HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
    }
}

Modifié par rafterman23, 03 juin 2010 - 01:52 .


#11
CID-78

CID-78
  • Members
  • 1 124 messages
the player allways has a character. it default to a human male with a fixed facegen. and a single hitpoint.



what the chargen does is goes from there to what the user wants it to be. you don't need the chargen, you can used a fixed character or another mean of "building" a character.



Loading the first area is done by putting the start loaction in it.

#12
Proleric

Proleric
  • Members
  • 2 355 messages
The wiki script works fine for me.

Presumably the module is standalone, and not an extension to the OC?

I wonder whether there's conflict with something else (though since the OC is working, we can probably rule out mod incompatibility).

Maybe try clearing out the packages override folder anyway, for good order. 

Try making a module which consists of nothing except the character generation script and an area with a start waypoint, ensuring that the area has been exported (by checking the contents of the add-in module override folder).

If that works, something else in your module is conflicting with character generation.

#13
CID-78

CID-78
  • Members
  • 1 124 messages
i had some issues with the chargen and the character creator utility for this forum. ie it messed up my install once, causing black preview and wrecked facegen. maybe you have a similiar conflict.

#14
rafterman23

rafterman23
  • Members
  • 9 messages
i cleared my override folder, and made an area with just a starting waypoint, and had the module fire the chargen script. still black previews.

#15
Proleric

Proleric
  • Members
  • 2 355 messages
Worth checking that the module properties Content Module and Extended Module are both (None). @CID-78 : what was the fix for the character creator issue?

#16
rafterman23

rafterman23
  • Members
  • 9 messages
yessir they both are none. still black previews.

#17
CID-78

CID-78
  • Members
  • 1 124 messages

Proleric1 wrote...

Worth checking that the module properties Content Module and Extended Module are both (None). @CID-78 : what was the fix for the character creator issue?


reinstallation of both game and toolset. if you can call that a fix.