Aller au contenu

Photo

Starting out with a premade character?


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

#1
Cromalic

Cromalic
  • Members
  • 114 messages
So I made a creature I call homer_simpson.utc, and in his inventory I added a beer.

I would like to start out as that character when I start the module.
I've looked over the scripts for character generation and the functions in the toolset, and I couldn't find anything which allows you to start out as a premade creature.

The current script I have skips character generation and gives me a human noble warrior, and I was able to load the items (beer) to homer_simpson.utc.
However I wasn't able to get the looks of the creature. How do I load a specific creature to start with?

Here's the script:

#include "events_h"
#include "global_objects_h"
#include "sys_chargen_h"
#include "utility_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:
{
// skip character generation
object oHero = GetHero();
Chargen_InitializeCharacter(oHero);
Chargen_SelectRace(oHero,RACE_HUMAN);
Chargen_SelectCoreclass(oHero,class_WARRIOR);
Chargen_SelectBackground(oHero,BACKGROUND_NOBLE);
 
LoadItemsFromTemplate(oHero, "homer_simpson.utc", TRUE);
 
break;
}
}
if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}


Please help.=]

Modifié par Cromalic, 21 novembre 2009 - 04:54 .


#2
Reynen Starfyre

Reynen Starfyre
  • Members
  • 52 messages
NM I see forums on here RUIN and CHANGE script.
I highly advise NO ONE use scripts on here because it changes the case on the scripts which will corrupt the game..
Brilliant....nothing like providing a script section and then having the forum engine break the code.....

For the code aboiut Coreclass should have two "C", but the forum breaks it

Modifié par Reynen Starfyre, 21 novembre 2009 - 02:20 .


#3
Cromalic

Cromalic
  • Members
  • 114 messages
Ok, just disregard the script then. But how do I make a module where a player starts out with a premade creature?

#4
emosicknesscom

emosicknesscom
  • Members
  • 22 messages
Cromalic, I looked into this last night for quite awhile. Tried a bunch of things, the only thing that seemed remotely promising was using SetAppearanceType. I was able to make the player start as Duncan (albeit, headless), and some other creatures. I couldn't use a creature I made in the toolset though. The valid appearances are located in APR_base.xls. I don't quite fully understand the 2DA stuff though, so I'm not sure how one would add an appearance, or if it is even possible.

Another thing I tried was spawning the creature and using that as the object argument to the Chargen_* functions... this didn't seem to work for me, but I could have been doing something wrong.

Modifié par emosicknesscom, 21 novembre 2009 - 05:44 .


#5
EmsaFallkin

EmsaFallkin
  • Members
  • 74 messages
The APR_base.xls has columns for head, hair and eyes. May have to create a new "creature entry" in APR_base.xls and call that new creature with SetAppearanceType.

#6
emosicknesscom

emosicknesscom
  • Members
  • 22 messages
I created a new creature entry, but I'm not sure where to put the APR_base.GDA. Directly in the override directory or override/toolsetexport/? When I put it in either and both of those places, I tried to SetAppearanceType to 90 (my added creature's ID) it seemed like nothing happened.

Also, the head, hair and eyes are ints. I'm not quite sure what to do with those. I looked in the Heads.xls file to see if it was in there and found all of the entries that are option in the toolset in the creature creator but not anywhere to put head morphs.

Modifié par emosicknesscom, 21 novembre 2009 - 08:05 .


#7
EmsaFallkin

EmsaFallkin
  • Members
  • 74 messages
I've also tried it and to see that it works I changed the different speeds of my "new creature" and it did work. I named it APR_template.GDA and put it in the toolsetexport folder. I used the ID 60001.



But changing the in values for head, hair and eyes didn't do what I wanted. Missing hair texture in the case of the hair int.

#8
Cromalic

Cromalic
  • Members
  • 114 messages
You can't simply do this through scripting? Didn't Bioware think to add this? Really weird, I mean it should be rather obvious that a lot would like to tell a tale with a specific character in mind.

#9
Cromalic

Cromalic
  • Members
  • 114 messages
emosicknesscom, did you try to use GetAppearanceType() to acquire an appearance from a creature you created? And afterwards set that to the main char using SetAppearanceType?

#10
Gralamin

Gralamin
  • Members
  • 45 messages
According to http://dragonagemodd...-dragonage-ini/ there is a skip char-gen option. If you turn that on, and find the default character they give, perhaps you can simply replace that character?

#11
emosicknesscom

emosicknesscom
  • Members
  • 22 messages
EmsaFallkin, The head, hair and eyes seem to be an id referring to a specific sheet on the corresponding 2DA. And those are the "Cut"/Don't Use ones from the creature creator in the toolset.



Cromalic, GetAppearanceType() should return the id for the human player in APR_Base. I'll give it a try anyway.



Gralamin, skipping char gen is default when making a module. However, you might be onto something. Replacing the default character (making a character called default_player) might just work. Now to figure out how to make a creature whose resource name is already used...

#12
emosicknesscom

emosicknesscom
  • Members
  • 22 messages
Alright, I managed to do it. Using what Gralamin suggested, once my module was exported. I changed the filename of my creature to default_player.utc in my module's override directory. That seems to have done the trick. I wish there was an easier way, but that should be good enough for what we need for now.

EDIT: Whoops, also forgot I re-opened the creature (File->Open) with the toolset and changed the TemplateResRef and Tag to default_player as well.

Modifié par emosicknesscom, 22 novembre 2009 - 06:47 .


#13
EmsaFallkin

EmsaFallkin
  • Members
  • 74 messages
But that will affect the Single Player character as well will it not (as well as any mods)? Would have liked bioware to simply add a function similar to the LoadItemFromTemplate. LoadPlayerFromTemplate, which loads all the stuff you set in an .utc file, including the head morph.

Edit: nvm me, I was thinking you put it in the shared override folder. Need my coffee.

Modifié par EmsaFallkin, 22 novembre 2009 - 09:31 .


#14
emosicknesscom

emosicknesscom
  • Members
  • 22 messages
It will affect the single player character if you put it in the override for the Single Player module. As I said, I put this in the override directory for my mod. AddIns\\Module ID Name Here\\module\\override\\toolsetexport\\

I'm still not willing to give up on the SetAppearanceType, since character generation scripts seem to use it. I'm pretty sure this wouldn't work if you were to use the toolset to make a distributable mod. You could still extract and rezip the dazip file, but that would get annoying. Anyway, this is just a workaround for now.

Modifié par emosicknesscom, 22 novembre 2009 - 09:32 .


#15
Gralamin

Gralamin
  • Members
  • 45 messages

emosicknesscom wrote...

It will affect the single player character if you put it in the override for the Single Player module. As I said, I put this in the override directory for my mod. AddIns\\\\Module ID Name Here\\\\module\\\\override\\\\toolsetexport\\\\

I'm still not willing to give up on the SetAppearanceType, since character generation scripts seem to use it. I'm pretty sure this wouldn't work if you were to use the toolset to make a distributable mod. You could still extract and rezip the dazip file, but that would get annoying. Anyway, this is just a workaround for now.


It's good to see that my idea worked out to at least a partial solution. Now a full solution is all that is needed.

#16
emosicknesscom

emosicknesscom
  • Members
  • 22 messages
After searching through many scripts and xls files I've still come up with the same results. The SetAppearanceType() works fine if you are changing the whole model, but does not seem to allow for a head morph. The HEAD_WORKSHEET, HAIR_WORKSHEET, etc. refer to the 2DA id which specifies which sheet the options are drawn from. This seems to only be for character generation to present options rather than supply default face parts.

#17
Fathom

Fathom
  • Members
  • 10 messages
Anyone have any luck with this? This is a key point of a mod im working on

#18
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
Here's something you can try. Didn't look up all the proper functions, but you get the idea. Watch out for capitalization of the word class...BSN likes to convert it to all lower case for some reason.
[dascript]
#include "events_h"
#include "global_objects_h"
#include "sys_chargen_h"
#include "utility_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:
      { // skip character generation
        object oHero = GetHero();
        Chargen_InitializeCharacter( oHero );
       
        object oHomer = CreateObject( OBJECT_TYPE_CREATURE, R "homer_simpson.utc", GetLocation( oHero ));
        // duplicate characteristics of Homer onto the hero
        Chargen_SelectBackground( oHero, BACKGROUND_NOBLE ); // unable to find function to GetBackground, but if there is one here's the place for it.
        Chargen_SelectGender( oHero, GENDER_MALE );          // unable to find function to GetGender, "
        Chargen_SelectRace( oHero, GetCreatureRacialType( oHomer ));
        if(      GetclassRank( oHomer, class_WARRIOR )) Chargen_SelectCoreclass( oHero, class_WARRIOR );
        else if( GetclassRank( oHomer, class_ROGUE ))   Chargen_SelectCoreclass( oHero, class_ROGUE );
        else                                            Chargen_SelectCoreclass( oHero, class_MAGE );
       
        // Don't forget appearance and sound sets.
        SetAppearanceType( oHero, GetAppearanceType( oHomer ), TRUE );
        //Soundset??? unable to find how to do this.
        
        // Abilities, skills, talents & spells need to be duped too...
       
        // And finally the items.
        LoadItemsFromTemplate( oHero, "homer_simpson.utc", TRUE);
        DestroyObject( oHomer );  // destroy homer template -- doh!!
      }
      break;
  }
  // If this event wasn't handled by this script, let the core script try
  if( !nEventHandled ) HandleEvent( ev, RESOURCE_SCRIPT_MODULE_CORE);
}
[/dascript]

Modifié par Axe_Murderer, 23 novembre 2009 - 05:45 .


#19
emosicknesscom

emosicknesscom
  • Members
  • 22 messages
Thanks for the input, Axe_Murderer. That was tried I didn't mention it though. The appearance types are"nAppearanceId - Appearance 2da row index. Use -1 to return to original appearance" (From SetAppearanceType help) and a custom character isn't going to be in there.

#20
Fathom

Fathom
  • Members
  • 10 messages
So if we want the player to use a preset already made character wwe have to do whats above?



And im guessing also if the preset character has a custom class, it gets even more complicated?

#21
emosicknesscom

emosicknesscom
  • Members
  • 22 messages
Fathom, replacing the default_character.utc will have nothing to do with the script Axe_Murderer posted (which is the proper way to setup a character, minus the CreateObject,SetAppearanceType and DestroyObject.) You could do the above and set it to whatever class you'd like in the script as long as you have already defined a new class.

#22
Cromalic

Cromalic
  • Members
  • 114 messages
emosicknesscom, from what I understand, replacing default_character.utc is only something you can do before a game, right?

What if you want to change your character's looks midgame? Maybe he grows a beard? Or maybe a prequel where you play as a kid, then the game continue with your character all grown up.

Is this possible?

#23
FalloutBoy

FalloutBoy
  • Members
  • 580 messages

Cromalic wrote...

emosicknesscom, from what I understand, replacing default_character.utc is only something you can do before a game, right?
What if you want to change your character's looks midgame? Maybe he grows a beard? Or maybe a prequel where you play as a kid, then the game continue with your character all grown up.
Is this possible?


Excellent question! I loved the way Fable 2 handled this, especially the flashback sequence near the end of the game where you see how you looked at various stages of your life. That was my favorite part of the game.

#24
Cromalic

Cromalic
  • Members
  • 114 messages
Bump.

Anyone found a solution to this yet?

#25
emosicknesscom

emosicknesscom
  • Members
  • 22 messages
Sorry, I haven't had much time to put into DAO lately.

Anything that doesn't involve a head morph (like child to adult transition) can be done with SetAppearanceType since you can define a body model. Still have no idea to change the head without overriding the default character creature.