Aller au contenu

Photo

Just made a new module, but my character is bald and generic


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

#1
LordJared88

LordJared88
  • Members
  • 145 messages
It totally skipped character creation, which is fine, because I want to have a pre-defined character for this module anyways.

How do I create a pre-defined player character that it automatically loads up the module as?  Any way I can just edit the template of this generic bald guy it's making me play as?

#2
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
I think you'd need to require somebody to import a save with your character during character creation - the start chargen function has an argument to allow character import or not.

Or another way I guess is to swap out the GetHero() object for another follower you've added with SetPartyLeader() or whatever the function is again.

Modifié par FollowTheGourd, 25 avril 2011 - 09:30 .


#3
LordJared88

LordJared88
  • Members
  • 145 messages
Okay. What does the code look like that asks you to import a character?

#4
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Look at the "demo tutorial" module's demo_module.nss code in the toolset. Changing it to StartCharGen(GetHero(), 0, TRUE) ought to do it for "void StartCharGen(object oCreature, int nMode = 0, int nImportEnabled = FALSE)"


Default non-import code in demo_module.nss:
case EVENT_TYPE_MODULE_START:
{
//This sets a particular world map as being the current "primary" map.
//We only have one map in this module so we can set it once here and not
//need to worry about keeping track of it later.
object oMapId = GetObjectByTag("demo000mp_world");
WR_SetWorldMapPrimary(oMapId);

//start character generation.
PreloadCharGen();
StartCharGen(GetHero(),0);
break;
}

Modifié par FollowTheGourd, 25 avril 2011 - 09:45 .


#5
LordJared88

LordJared88
  • Members
  • 145 messages
Very cool. Before I go messing anything up, I change the script under module properties right?

#6
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Yeah, don't alter module_core or any script that doesn't belong to your module for this.

#7
LordJared88

LordJared88
  • Members
  • 145 messages
I went into the script editor and created a new script called 'module_start.nss'. Within that script it says:

case EVENT_TYPE_MODULE_START:
{
//This sets a particular world map as being the current "primary" map.
//We only have one map in this module so we can set it once here and not
//need to worry about keeping track of it later.
object oMapId = GetObjectByTag("demo000mp_world");
WR_SetWorldMapPrimary(oMapId);

//start character generation.
PreloadCharGen();
StartCharGen(GetHero(),0);
break;
}

I went under module properties and changed the script from module_core to module_start, but when I fire up the game, it still skips this.

I am not sure if I am preparing my module correctly to be launched however. All I am doing is clicking 'all', highlight all of my customer resources and selecting 'export > export without dependent resources'.

Is there some other way I should prepare the module to be launched in game?

#8
LordJared88

LordJared88
  • Members
  • 145 messages
I feel pretty stupid.

I guess I am that thick that I need to see the steps spelled out one by one. Not really sure where to place the script to have any effect or how to CORRECTLY package up my module to prepare it to be launched in-game.

#9
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Don't fret it, just take your time to see what the demo script is doing exactly.

The quick way to get you started should be this:
1) Create the new script
2) Click the "templates" icon in the panel beside the script editor:
Posted Image
3) In an empty script, click "custom module events.txt" to insert the template script.
4) Edit the script under EVENT_TYPE_MODULE_START as needed. You just need PreloadCharGen() and StartCharGen(). You don't need to do the map stuff there - at least to get this working.
5) Save it, and make sure it compiles without error.
6) Right click on your script in the far-right window, "Palette Window - Script".
7) "Export -> Export without dependent resources" should be enough.
8) In the module properties, set the script (not the client script) to your custom script.

See also:
http://social.biowar...ipting_overview
http://social.biowar...ipting_tutorial

Modifié par FollowTheGourd, 25 avril 2011 - 11:08 .


#10
LordJared88

LordJared88
  • Members
  • 145 messages
Alright, cool. Thank you so much. I have to head to work at the moment, but the second I get home I'll try this out.

#11
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Here's a paste of the whole script - it should work... it's just two lines added to to module template that comes with the toolset.

http://pastebin.ca/2050657

Modifié par FollowTheGourd, 25 avril 2011 - 11:04 .


#12
LordJared88

LordJared88
  • Members
  • 145 messages
Interesting. Well, I tried copying that line by line, because if I copy and paste the whole thing, it pastes line numbers next to it. When I tried to compile the script, it told me there was an error.

Any way you could email a copy of the script as a .txt file to jackalhead at live dot com? I think if I copy and paste from a text file, it won't put strange numbers for each line when I copy and paste it in the script editor.

Thank you for being patient with me.

#13
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
You can get it this way without line numbers:
http://pastebin.ca/raw/2050657

But it's really just two lines added to the standard module events template. If it still doesn't compile, it's possible I might have made a mistake somewhere - but if you can't compile it, just give me the exact error message from the log.

Modifié par FollowTheGourd, 26 avril 2011 - 05:30 .


#14
LordJared88

LordJared88
  • Members
  • 145 messages
It works! You rock, Gourd. Thank you.

Now, if only I can figure out why I see a sky inside my dungeons and why my rooms don't connect in game. Depending on which room the start location is in, that is the only room I can even see when I fire the game up.