Author Topic: Character customisation errors.  (Read 10098 times)

0 Members and 1 Guest are viewing this topic.

Offline Allen

Character customisation errors.
« on: August 25, 2004, 07:05:30 AM »
Hey, I just recently wrote up this code, but it doesn't work properly. It is supposed to check s1 for a name, then go to the next label. It does all of this, but for one thing.
After the name part, when you push F8, the character portrait changes, so you can change how you look. Eg, race, hair color, etc. This doesn't work. it just stays at loop 0. (empty cel)
I've spent about 2 days figuring this out, but to no avail.
It's not a problem with setting the key, because using F8 in another logic works. I think it's just a nice little bug that I keep missing.

Code: [Select]
if (isset(f5)) {
  load.pic(v0);
  draw.pic(v0);
  discard.pic(v0);
  show.pic();
  animate.obj(o1); //Player Portrait
  load.view(3);
  set.view(o1,3);
  position(o1,8,50);
}
else{return();}

statsheet:
if (!isset(f17)) {
  goto(getname);
}
else {
  goto(hasname);
}

return();

getname:
text.screen();
status.line.off();
set(f17);
prevent.input();
get.string(s1,"What is your name?\n\n  My Name Is: ",1,10,16);
set.string(s2,"");
if (compare.strings(s1,s2)) {
  set.string(s1,"Rachley");
}
graphics();
goto(statsheet);
return();

hasname:
reset(f17);
set.text.attribute(0,15);
display(4,16,"%s1");
set.text.attribute(15,0);
draw(o1);
v70 = 0;

if (controller(c34)) { //F8
if(v70 == 0){ //Portrait loop no.
v70++;
set.loop(o1,1);
return();
}
if(v70 == 1) {
v70++;
set.loop(o1,2);
return();
}
if(v70 == 2){
v70++;
set.loop(o1,3);
return();
}
if(v70 == 3){
v70++;
set.loop(o1,4);
return();
}
if(v70 == 4){
v70++;
set.loop(o1,5);
return();
}
if(v70 == 5){
v70++;
set.loop(o1,6);
return();
}
if(v70 == 6){
v70 = 1;
set.loop(o1,1);
return();
}
}
return();

// Messages
#message 1 "What is your name?\n\n  My Name Is: "
#message 2 ""
#message 3 "Rachley"
#message 4 "%s1"
It's probably a blatant bug in there, but I don't see it. If it makes me look stupid, please be nice about it. ;D


http://www.mizpro.co.uk
The new home of Mizar Productions.

It is a sign!

Offline robingravel

Re:Character customisation errors.
« Reply #1 on: August 25, 2004, 08:08:56 AM »
I guess you forget to add Draw in your code. Add it to each subroutine you have like this one.

Quote
if(v70 == 1) {
v70++;
set.loop(o1,2);
draw(o1);
return();
}

It should work.


Robin Gravel

Offline Allen

Re:Character customisation errors.
« Reply #2 on: August 25, 2004, 09:27:17 AM »
 ::)
I knew it was something stupid. Thanks, Robin.
http://www.mizpro.co.uk
The new home of Mizar Productions.

It is a sign!

Kon-Tiki

  • Guest
Re:Character customisation errors.
« Reply #3 on: August 25, 2004, 09:31:39 AM »
Be glad it's no ; you forgot, or a curly bracket placed wrong. Such little stupidities're the most common bug, and are severe headaches when debugging ;)

Offline Allen

Re:Character customisation errors.
« Reply #4 on: August 25, 2004, 09:45:24 AM »
Argh, just tested and it didn't fix it.
Could it be the prevent.input(); command that's doing it?
http://www.mizpro.co.uk
The new home of Mizar Productions.

It is a sign!

Offline Allen

Re:Character customisation errors.
« Reply #5 on: August 25, 2004, 09:55:07 AM »
Argh, never mind. I'll get round this another way.
http://www.mizpro.co.uk
The new home of Mizar Productions.

It is a sign!


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.036 seconds with 21 queries.