PlaneShift
Development => Development Deliberation => Topic started by: ctlmo5 on September 02, 2007, 08:35:38 am
-
Hello:
If i have a new character(model), and i added into character.zip in the "art". And i set the database table "common_strings" and "race_info". Now i can change the "racegender_id" in table "character" to show my the model for the character. However, if i want to change the race when i crate a character in the game - planeshift!?
I know there have two xml and a cpp file is related to character, that is charcreate.xml and descriptions.xml and psraceinfo.cpp. So it is possible to create the character with my new model(new race) without changing the cpp file?
If the answer is "NO", how can i changed that cpp file, because i tried already, and i am failed.
-
I can follow your reasoning to a point, but without specific examples I'm afraid you're losing me somewhere along the way. What exactly didn't work?
Did you create a completely new race and added it to race_info and common strings? Did you find any of the races information hardcoded in planeshift?
-
I can follow your reasoning to a point, but without specific examples I'm afraid you're losing me somewhere along the way. What exactly didn't work?
Did you create a completely new race and added it to race_info and common strings? Did you find any of the races information hardcoded in planeshift?
OK, let say the new race call "cat".
I added the "cat" to character.zip in art.
and i start to add new row in the planeshift database tables - common_strings and race_info
common_strings:
INSERT INTO `common_strings` VALUES (2700, 'cat');
race_info:
INSERT INTO `race_info` VALUES (32, 'Cat', 2700, 'M', -20.00, 4.00, -150.00, 0, 0, 0, 3, 0.00, 19, 100, 50, 50, 50, 50, 50, 50, 10, 10, 10, 10, 0, '');
NOW, i can change the race for the character i want.
In table - characters. racegender_id is the race for the character using, if i change the number to 32, that my character's race will be come a cat.
That is no program to just change the database to make the race work.
How about if i want to add/replace a new race in the "create character page" which is after you enter your user name and password and press "new character".
That page is control by two xml file - charcreate.xml and descriptions.xml
charcreate.xml - control the gui of "create character page". (data -> gui -> charcreate.xml)
For example:
<widget name="race1" factory="pawsRadioButton" id="1">
<frame x="17" y="216" width="175" height="24"/>
<text string="Cat" position="right"/>
</widget>
Now the name of the race in that page will show "cat".
descriptions.xml - control the description and the model you can see in that "create character page". (data -> races -> descriptions.xml)
For example:
<race name="Cat"
description="I am cat"
basetexture="1.png"
male="cat"
female="cat"
male_available="yes"
female_available="no">
<FirstPos x="0" y="1.56" z="0" />
</race>
The cat model will be show in the middle of the create page.
Now, if i choose "cat" for my new character to join the game, the character in the game will not be my model "cat", that will be the org-planeshift model.
My Question is how to make the model able to load in the game by using "create character page".
-
Thanks for the explanation. This is more like it! :) I'm really not qualified to answer this but in my opinion, there may be a problem here:
<widget name="race1" factory="pawsRadioButton" id="1">
<frame x="17" y="216" width="175" height="24"/>
<text string="Cat" position="right"/>
</widget>
What does id="1" match? Maybe something in the DB somewhere, or worse, just like you said, in the code. It would really suck though for character info to be hardcoded.
Everything else makes sense.
-
I've never looked at the code myself, but up until recently, at least some info was hard coded, but according to the changelog:
*** 2007-08-30 by Sasha Levin
- Removed hardcoded race info
So maybe you're using an outdated version of the code, and my want to update and see what has been changed in that area.