Hi can anyone help me. I want to let players name their character, choose their race and class.
I’ve put the name, race and class options in both the mygame.js and the choicestats file but keep getting errors.
Hi can anyone help me. I want to let players name their character, choose their race and class.
I’ve put the name, race and class options in both the mygame.js and the choicestats file but keep getting errors.
It would help if you post your code and the error message.
this is the code for the choicescript_stats page
Your abilities
*stat_chart
text Name
text Race
text Class
text Firearms
text Training
text Fitness
text Medical
text Armor
text Science
text Technology
text Biotics
this is the code for the mygame.js page
/*
* Copyright 2010 by Dan Fabulich.
*
* Dan Fabulich licenses this file to you under the
* ChoiceScript License, Version 1.0 (the “License”); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.choiceofgames.com/LICENSE-1.0.txt
*
* See the License for the specific language governing
* permissions and limitations under the License.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied.
*/
// Specify the list of scenes here, separated by commas, with no final comma
nav = new SceneNavigator([
“startup”
,“class”
,“variables”
,“gosub”
,“ending”
,“death”
]);
// Specify the default starting stats here
stats = {
name: unknown
,race: unknown
,class: unknown
,firearms: 0
,training: 0
,fitness: 0
,medical: 0
,armor: 0
,science: 0
,technology: 0
,biotics: 0
};
// Specify the stats to use in debug mode
debugStats = {
name: unknown
,race: unknown
,class: unknown
,firearms: 0
,training: 0
,fitness: 0
,medical: 0
,armor: 0
,science: 0
,technology: 0
,biotics: 0
};
// or just use defaults
// debugStats = stats
the error message
says unknown is not defined
so how would I define unknown?
just put quotes around them:
name: “unknown”
thank you it seems to have worked.