[Add-On] Learning NPC scripts (beginner's guide)

Page 14 of 22 FirstFirst ... 4678910111213141516171819202122 LastLast
Results 196 to 210 of 328
  1. #196
    Account Upgraded | Title Enabled! GoldenNuts is offline
    MemberRank
    Apr 2009 Join Date
    Los AngelesLocation
    209Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Very Useful to me! =]

  2. #197
    Apprentice ohad77 is offline
    MemberRank
    Mar 2009 Join Date
    7Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    thank you very much XD

  3. #198
    I'm back ಠ_ಠ Garvorious is offline
    MemberRank
    Apr 2008 Join Date
    Planet EarthLocation
    1,175Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Can you check out my code, I got a few errors.

    Code:
    // Created by Garvorious
    // NPC: The Perma-Noob Teleporter
    var status = 0;
    function start() {
     status = -1;
     action(1, 0, 0);
    }
    function action(mode, type, selection) {
     if (mode == -1) {
      cm.dispose();
     }
     else {
      if (status >= 2 && mode == 0) {
       cm.sendOk("All right, enjoy iStory!");
       cm.dispose();
       return;
      }
      if (mode == 1) {
       status++;
      }
      else {
       status--;
      }
    
      if (status == 0) {
       cm.sendNext("Hey! Welcome to iStory. I'm Garv's bitch here to help you out.");
      }
      else if (status == 1) {
       cm.sendSimple("Since the magic bush teleports users, Im here to tele you. Sorry for the confusion");
      }
      else {
       cm.sendOk("Where do you want to go? \r\n#L0I want to go to Victoria Island!#l\r\n#L1#I want to be a Perma-Noob.#l");
      }
      else if (status == 2) {
       if (selection == 0) {
       cm.sendOk("Allright, have fun in Victoria Island!);
       cm.warp(100000000, 0);
       cm.dispose();
      }
      else if (selection == 1) {
       cm.sendOk("Okay, have fun being a noob!");
       cm.warp(1010000, 0) {
       cm.dispose();
      }
     }
    }
    Sorry for the close spaceing, the copy paste didnt copy all of it.

    Here's the acual .js:

    http://www.mediafire.com/?xddrxiodm2d

  4. #199
    Infraction Banned XxOsirisxX is offline
    MemberRank
    Jul 2008 Join Date
    2,456Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Quote Originally Posted by Garvorious View Post
    Can you check out my code, I got a few errors.

    Code:
    // Created by Garvorious
    // NPC: The Perma-Noob Teleporter
    var status = 0;
    function start() {
     status = -1;
     action(1, 0, 0);
    }
    function action(mode, type, selection) {
     if (mode == -1) {
      cm.dispose();
     }
     else {
      if (status >= 2 && mode == 0) {
       cm.sendOk("All right, enjoy iStory!");
       cm.dispose();
       return;
      }
      if (mode == 1) {
       status++;
      }
      else {
       status--;
      }
    
      if (status == 0) {
       cm.sendNext("Hey! Welcome to iStory. I'm Garv's bitch here to help you out.");
      }
      else if (status == 1) {
       cm.sendSimple("Since the magic bush teleports users, Im here to tele you. Sorry for the confusion");
      }
      else {
       cm.sendOk("Where do you want to go? \r\n#L0I want to go to Victoria Island!#l\r\n#L1#I want to be a Perma-Noob.#l");
      }
      else if (status == 2) {
       if (selection == 0) {
       cm.sendOk("Allright, have fun in Victoria Island!);
       cm.warp(100000000, 0);
       cm.dispose();
      }
      else if (selection == 1) {
       cm.sendOk("Okay, have fun being a noob!");
       cm.warp(1010000, 0) {
       cm.dispose();
      }
     }
    }
    Sorry for the close spaceing, the copy paste didnt copy all of it.

    Here's the acual .js:

    http://www.mediafire.com/?xddrxiodm2d
    PHP Code:
    var status = -1//Why puting the value of 0 here, and -1 ni start function? it's a waste of time.
    function start() {
        
    cm.sendNext("Hey! Welcome to iStory. I'm Garv's bitch here to help you out."); //In this case, this can basically remplace the action(1,0,0) since the user will make the value at next.
    }

    function 
    action(modetypeselection) {
        
    status++; //status will never get status--, so, why bother to add it?
        
    if (mode == -1) { //Reduce all  the shit, because the one you used it obvious a copy paste from another one, plus, it will never be mode == 0 unless you press Exit Chat in sendSimple, but since it said "&& status >= 2", then it will NEVER research that point.
            
    cm.dispose();
            return;
        }
        if (
    status == 0//Removed brackets because It's only 1 line of procedure, you cna leave the brackets, I just like it without brackets.
            
    cm.sendSimple("Since the magic bush teleports users, Im here to tele you. Sorry for the confusion\r\n #L0#Continue talking slut"); //ou forgot to add a option. Or not use sendSimple here.
        
    else if(status == 1//You don't put "else" to choose a option. Also I removed brackets again.
            
    cm.sendSimple("Where do you want to go? \r\n#L0#I want to go to Victoria Island!#l\r\n#L1#I want to be a Perma-Noob.#l"); //You forgot a # after #L0, Also, this should be sendSimple
        
    else if (status == 2) {
            
    cm.sendOk(selection == "Allright, have fun in Victoria Island!" "Okay, have fun being a noob!"); //You missed a " in the victoria one, Also I make it shorten.
            
    cm.warp(selection == 100000000 1010000); //Why defining the spawn point if it's 0? lets just use the 1 parameter one. ALso, I make it shorten too.
            
    cm.dispose(); //1 dispose at the end with you way of do this would be better, since boths will research this part anyhow.
        
    }

    Thought you where dev.

  5. #200
    I'm back ಠ_ಠ Garvorious is offline
    MemberRank
    Apr 2008 Join Date
    Planet EarthLocation
    1,175Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    So you're saying devs are perfect in every way?

    I never knew that o.o


    Well the comments, deserves a thanks.

  6. #201
    Infraction Banned XxOsirisxX is offline
    MemberRank
    Jul 2008 Join Date
    2,456Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Quote Originally Posted by Garvorious View Post
    So you're saying devs are perfect in every way?

    I never knew that o.o
    I'm saying Dev's know what they are doing. Not need to be perfect, but you seem to have no idea of what you're doing.

  7. #202
    I'm back ಠ_ಠ Garvorious is offline
    MemberRank
    Apr 2008 Join Date
    Planet EarthLocation
    1,175Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Quote Originally Posted by XxOsirisxX View Post
    I'm saying Dev's know what they are doing. Not need to be perfect, but you seem to have no idea of what you're doing.
    So, you say you're perfect? ._.

  8. #203
    Infraction Banned XxOsirisxX is offline
    MemberRank
    Jul 2008 Join Date
    2,456Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Quote Originally Posted by Garvorious View Post
    So, you say you're perfect? ._.
    I'm just thinking that you're retard, because you can't read, yet, try to find a way to makes me say something that does goes "invert" to what I already said.

    And if you read my post it does says:

    I'm saying Dev's know what they are doing. Not need to be perfect, but you seem to have no idea of what you're doing.
    Indeed, I'm not perfect, I made a lot of mistakes that are uncountable, we are humans, but, make mistake and not knowing what you're doing are two things way different.

    That last sentence response you next post.

  9. #204
    I'm back ಠ_ಠ Garvorious is offline
    MemberRank
    Apr 2008 Join Date
    Planet EarthLocation
    1,175Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Quote Originally Posted by XxOsirisxX View Post
    I'm just thinking that you're retard

    Lol I'm sorry I just had to point that out.

    Fine, I call truce. Do you?

    I'll refrain from starting a useless flame war and end up infraction ban crazy from a mod but whatev.

    Just saying, there are many devs. Some great such as yourself, some not, like me. We're not all like DeadlyData and can do amazing things. But hey its all practice and takes time.

  10. #205
    Infraction Banned XxOsirisxX is offline
    MemberRank
    Jul 2008 Join Date
    2,456Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Quote Originally Posted by Garvorious View Post
    Lol I'm sorry I just had to point that out.

    Fine, I call truce. Do you?

    I'll refrain from starting a useless flame war and end up infraction ban crazy from a mod but whatev.

    Just saying, there are many devs. Some great such as yourself, some not, like me. We're not all like DeadlyData and can do amazing things. But hey its all practice and takes time.
    Agreed. I tried to help with you script putting the reason of stuffs, even that all there are predefined methods. But yeah.. nvm, truce accepted.

  11. #206
    I'm back ಠ_ಠ Garvorious is offline
    MemberRank
    Apr 2008 Join Date
    Planet EarthLocation
    1,175Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Yay no mod involved ._.

    Flame warz avoided.

  12. #207
    Apprentice dragon1563 is offline
    MemberRank
    Jun 2008 Join Date
    17Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    Confused with level 3.
    How do i know when to put else and when to put else if?

  13. #208
    Account Upgraded | Title Enabled! Popozow1012 is offline
    MemberRank
    Jul 2008 Join Date
    Where it's nine in the afternoonLocation
    549Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    I get it now :D Thank you I can finally edit this damn npc i've been working on

  14. #209
    Valued Member iqasdfg is offline
    MemberRank
    Apr 2009 Join Date
    111Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)



    i get stuck at the character screen still
    i've done everything correctly, from mysql to wz files
    help please !

  15. #210
    Apprentice CYLay is offline
    MemberRank
    Mar 2009 Join Date
    21Posts

    Re: [Tut] Learning NPC scripts (beginner's guide)

    where do i find tutorial for how to add php code into server (MySQL)? i can't just paste it in and run it would comes out alot of errors. any help?



Advertisement