Author Topic: Bug fix  (Read 2872 times)

0 Members and 1 Guest are viewing this topic.

Kon-Tiki

  • Guest
Bug fix
« on: September 01, 2002, 11:32:43 AM »
Hi, I've got yet another problem ::) This time, it's just a bug I noticed while programming my bar. If I do 'talk man' and I'm near a person I can talk to, it first says the thing it should say when you're not near a person. It works fine with the bartender, but the other person I've programmed already gives that problem.
Here's my code:
Code: [Select]

if(said("talk","man")){
  if(posn(o0,50,125,65,137)) {
    set(f100);
  }
  if(posn(o0,5,115,20,140)) {
    set(f101);
   }
   if(posn(o0,106,126,124,145)) {
    set(f102);
   }
   if(posn(o0,35,104,140,120)) {
     set(f103);
   }
   else {
     print("My text.'");
   }
}


I hope this makes sense.

-Kon-Tiki-



Offline Cosmic R

Re:Bug fix
« Reply #1 on: September 01, 2002, 04:43:27 PM »
I'm not 100% sure what you're trying to do, but I think you want to put return(); statements at the end of each if statement, after you set each flag, but before the curly brace.

Offline happyturk

Re:Bug fix
« Reply #2 on: September 01, 2002, 06:42:07 PM »
Yeah, what's happening is that it's seeing:

if(posn(o0,35,104,140,120)) {
     set(f103);
   }
else {
     print("My text.'");
   }

And if it's not near the person in that third if statement, no matter whether it's near any of the others, it's going to the else and returning the message.

It'd be nifty if AGI had an 'else if' to go with the if and else; things like this would be a lot simpler. But you can either use returns as said, or just nest the if statements to simulate an 'else if':

if(said("talk","man")){
 if(posn(o0,50,125,65,137)) {
   set(f100);
 }
 else {
    if(posn(o0,5,115,20,140)) {
      set(f101);
      }
    else {
      if(posn(o0,106,126,124,145)) {
        set(f102);
        }
      else {
         if(posn(o0,35,104,140,120)) {
           set(f103);
           }
         else {
           print("My text.'");
           }
        }
     }
  }
}

Offline Nick Sonneveld

Re:Bug fix
« Reply #3 on: September 01, 2002, 08:19:48 PM »
it's not so much as else if option but allowing you to have an if statement without {} brackets.

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Kon-Tiki

  • Guest
Re:Bug fix
« Reply #4 on: September 02, 2002, 06:21:28 AM »
Thanks, it's working fine now. I figured the nested if-else statements out yesterday before going to sleep. It's pretty dull that I've looked over that option. Also, to see what I was trying to do, you'll have to wait a couple more days. The demo will then be ready (I'm not letting too much about it out yet, I've already said a bit too much :-X)

I've still got some questions left (although they don't concearn logic, but the game itself):

1) Which name do you prefer? [a] Little Pirate
                                                  Tales of the Ocean
                                                 [c] Piraatje
                                                 [d] Something else.

2) Should the character have a name? [a] Yes
                                                              No
                                                             [c] Don't care

These are just small things, but it could be handy while making the finishing touches.

-Kon-Tiki-
« Last Edit: September 02, 2002, 06:23:39 AM by Kon-Tiki »

Offline Nick Sonneveld

Re:Bug fix
« Reply #5 on: September 02, 2002, 07:16:48 AM »
Well you need to mention "pirate" because that's your main selling point.. How about "Pirate Adventures on the Ocean"?  (joke)

I think you should pick a name for your character.  I find I identify with the hero better than if I use my own name.

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Andrew_Baker

Re:Bug fix
« Reply #6 on: September 07, 2002, 02:01:54 PM »
Yeah, I like Little Pirate, and I agree with Nick that the player should get to use his/her own name.  It's a really standard convention in a lot of Japanese games to assume the central character is representative of the player (This is why Mario never speaks).

Keep working:)
I hope you realize that one day I will devour the Earth.

Kon-Tiki

  • Guest
Re:Bug fix
« Reply #7 on: September 07, 2002, 02:09:25 PM »
Ok, planned to name him 'Jake'. First 'Jake the kid', and while getting further in the game, getting a better nickname. I can still do that, but I'll have to search the code of Huize 44 before I can make the user choose his own name. It'll take another hour ;) (Which sets the total to +-10h. Dagnabbit.)

Ok, I'll see to it that it gets done and, if 'Little Pirate' really is better than for example 'The rise and fall of pirate Jake', I'll keep it.

Thanks

-Kon-Tiki-

Offline Nick Sonneveld

Re:Bug fix
« Reply #8 on: September 07, 2002, 09:20:21 PM »
as much as I like agreeing with everybody, I meant Kon-Tiki should pick the name.  I didn't know about the Japanese convention, but I always picked the default names when I played Square rpg's. :)

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Kon-Tiki

  • Guest
Re:Bug fix
« Reply #9 on: September 08, 2002, 04:59:18 AM »
I'll see what I can do. If I have the time to make the player choose the name, I'll put it in the game. If the player doesn't choose a name, it'll use a default name. This'll only be in the game if I have time today to put it in(wow: when the rest's finished.) Otherwise, the name'll be Jake.

-Kon-Tiki-

Kon-Tiki

  • Guest
Re:Bug fix
« Reply #10 on: September 08, 2002, 02:25:26 PM »
That feature'll be in it. (btw: Real life got in the way. The demo'll be ready tommorow or, when I got lots of problems, the day after that, but normally tomorrow.)

-Kon-Tiki-


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

Page created in 0.053 seconds with 17 queries.