Author Topic: add a new race  (Read 1512 times)

ctlmo5

  • Traveller
  • *
  • Posts: 35
    • View Profile
add a new race
« 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.


Ralleyon

  • Hydlaa Citizen
  • *
  • Posts: 304
  • Protector in the Survivors of Vaern
    • View Profile
Re: add a new race
« Reply #1 on: September 03, 2007, 01:04:21 am »
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?
« Last Edit: September 03, 2007, 01:10:09 am by Ralleyon »
To see the world in a grain of sand
And Heaven in a wild flower,
Hold Infinity in the palm of your hand
And Eternity in an hour.
     
   [William Blake - Auguries of Innocence]

ctlmo5

  • Traveller
  • *
  • Posts: 35
    • View Profile
Re: add a new race
« Reply #2 on: September 03, 2007, 04:48:51 pm »
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".
« Last Edit: September 03, 2007, 04:50:39 pm by ctlmo5 »

Ralleyon

  • Hydlaa Citizen
  • *
  • Posts: 304
  • Protector in the Survivors of Vaern
    • View Profile
Re: add a new race
« Reply #3 on: September 03, 2007, 07:56:23 pm »
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:

Quote from: ctlmo5
<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.
« Last Edit: September 03, 2007, 07:58:28 pm by Ralleyon »
To see the world in a grain of sand
And Heaven in a wild flower,
Hold Infinity in the palm of your hand
And Eternity in an hour.
     
   [William Blake - Auguries of Innocence]

neko kyouran

  • Guest
Re: add a new race
« Reply #4 on: September 04, 2007, 01:27:51 pm »
I've never looked at the code myself, but up until recently, at least some info was hard coded, but according to the changelog:

Quote
*** 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.