Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20

Thread: Graal Client Help

  1. #1
    Player Abdullah1441's Avatar
    Join Date
    May 2015
    Location
    California
    Posts
    6,937

    Graal Client Help

    Cutting to the chase here:
    -How do I design NPCs* to say something then open fire?
    -How can I assign alignments?
    -How can I display a message* when you FIRST log into the game? (Part of tutorial)
    (All for now)

    NPC1: *grabs Guard, flings him to the floor, and shoots him* Listen up! Unless you want to end up like our little friend here, I expect every last shilling, and any other wealth, to be here in ten minutes!
    Message: After the Great Massacre, humanity was driven to its knees. However, it wasn't long until survivors formed into groups & began to raise arms against rival groups. You're a simple farmer, living in a village not to far from the Guild of Heroes. A thus is your tale...
    Last edited by Abdullah1441; 11-19-2018 at 05:12 AM.

  2. #2
    Leveler
    Join Date
    Nov 2016
    Location
    US
    Posts
    1,309
    Are you trying to make a graal server or..?
    Feel free to ask any question!

    iZone Levels Admin

  3. #3
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Uh, this should probably go in the subforum for NPC scripting.

    Anyway, here's a basic script that'll get you started for your guard NPC.
     Spoiler
    PHP Code:
    //#CLIENTSIDE //This sets the character look

    function onCreated() {
      
    this.showCharacter();
      
    this.head "head3.png";
      
    this.body "body2.png";
      
    this.attr[1] = "hat49.png";
      
    this.dir 2;
      
    this.firing false;
    }
    /*
    This function is for when the player touches the NPC,
    it'll show a message, and face the character.
    In scheduleevent, after 5 seconds, it'll call the function to shoot
    arrows at whatever direction it was pointing.

    this.firing makes sure that you can't repeatedly touch the NPC to keep
    it firing.

    */

    function onPlayerTouchsMe() {
      if (
    this.firing) return;
      
    this.firing true;
      
    say2("message here");
      switch (
    player.dir) {
      case 
    0:
        
    this.dir 2;
        break;
      case 
    1:
        
    this.dir 3;
        break;
      case 
    2:
        
    this.dir 0;
        break;
      case 
    3:
        
    this.dir 1;
        break;
      }
      
    scheduleevent(5"timeToRek");
    }
    /*With the for loop, the NPC will fire 6 arrows over a time
      of 3 seconds.

    */

    function onTimeToRek() {
      for (
    0<= 5i++) {
        
    shootarrow(this.dir);
        
    sleep(.5);
      }
      
    this.firing false;




    For your alignment assignment, I'm assuming you're talking about your AP.

    You can do something like this to change it:

     Spoiler
    PHP Code:
    //#CLIENTSIDE

    /*
      When the player touches the NPC, it'll assign a number between 0 and 100 as their AP.
      The int() is to round to the nearest integer. You can't set an AP with  decimal points.


    */
    function onPlayerTouchsMe() {
      
    player.ap int(random(0100));
    }

    function 
    onCreated() {
      
    this.showCharacter();
      
    this.head "head3.png";
      
    this.body "body2.png";
      
    this.attr[1] = "hat49.png";
      
    this.dir 2;
      
    this.chat "Touch me to set a random AP!";



    For those two solutions, you can use a level NPC or class. You'll need to join the class to the NPC though.

    To show a message on login, you could use a weapon/class/NPC script for it.
    It could go something like this:
     Spoiler
    PHP Code:
    //#CLIENTSIDE
    /*
    When the player logins or enters a specific level, and their flag for the tutorial completion if false, it'll display a message.
    You'll want to change that whenever they do finish the tutorial so it doesn't keep popping up.
    */
    function onPlayerEnters() {
      if (!
    clientr.tutorialCompleted) {
        
    say2("blahblahblah");
      }



    I saw. I conquered. I came.


  4. #4
    Player Abdullah1441's Avatar
    Join Date
    May 2015
    Location
    California
    Posts
    6,937
    Quote Originally Posted by kaz210 View Post
    Are you trying to make a graal server or..?
    That was the original plan, but then I realized that I needed to pay €50 (~$60) a year to keep my server running. That means I'm paying money to HIM to create content to keep HIS app alive... I've seen scummy people before, but this takes the cake.
    Quote Originally Posted by Grief Hero View Post
    Uh, this should probably go in the subforum for NPC scripting.

    Anyway, here's a basic script that'll get you started for your guard NPC.
     Spoiler
    PHP Code:
    //#CLIENTSIDE //This sets the character look

    function onCreated() {
      
    this.showCharacter();
      
    this.head "head3.png";
      
    this.body "body2.png";
      
    this.attr[1] = "hat49.png";
      
    this.dir 2;
      
    this.firing false;
    }
    /*
    This function is for when the player touches the NPC,
    it'll show a message, and face the character.
    In scheduleevent, after 5 seconds, it'll call the function to shoot
    arrows at whatever direction it was pointing.

    this.firing makes sure that you can't repeatedly touch the NPC to keep
    it firing.

    */

    function onPlayerTouchsMe() {
      if (
    this.firing) return;
      
    this.firing true;
      
    say2("message here");
      switch (
    player.dir) {
      case 
    0:
        
    this.dir 2;
        break;
      case 
    1:
        
    this.dir 3;
        break;
      case 
    2:
        
    this.dir 0;
        break;
      case 
    3:
        
    this.dir 1;
        break;
      }
      
    scheduleevent(5"timeToRek");
    }
    /*With the for loop, the NPC will fire 6 arrows over a time
      of 3 seconds.

    */

    function onTimeToRek() {
      for (
    0<= 5i++) {
        
    shootarrow(this.dir);
        
    sleep(.5);
      }
      
    this.firing false;




    For your alignment assignment, I'm assuming you're talking about your AP.

    You can do something like this to change it:

     Spoiler
    PHP Code:
    //#CLIENTSIDE

    /*
      When the player touches the NPC, it'll assign a number between 0 and 100 as their AP.
      The int() is to round to the nearest integer. You can't set an AP with  decimal points.


    */
    function onPlayerTouchsMe() {
      
    player.ap int(random(0100));
    }

    function 
    onCreated() {
      
    this.showCharacter();
      
    this.head "head3.png";
      
    this.body "body2.png";
      
    this.attr[1] = "hat49.png";
      
    this.dir 2;
      
    this.chat "Touch me to set a random AP!";


    Oh, my god... Thank you!
    For those two solutions, you can use a level NPC or class. You'll need to join the class to the NPC though.

    To show a message on login, you could use a weapon/class/NPC script for it.
    It could go something like this:
     Spoiler
    PHP Code:
    //#CLIENTSIDE
    /*
    When the player logins or enters a specific level, and their flag for the tutorial completion if false, it'll display a message.
    You'll want to change that whenever they do finish the tutorial so it doesn't keep popping up.
    */
    function onPlayerEnters() {
      if (!
    clientr.tutorialCompleted) {
        
    say2("blahblahblah");
      }

    Thank you!

    - - - Updated - - -

    But if I may...

    My alignment thing is kinda inspired by Ol' West's...

    I'm trying to code for ~5 groups each with they're own AP levels... (For example

    Hero (LL) AP: 0-3000
    Hero (LM) AP: 3001-6000
    Hero (LH) AP: 6001-9000
    Hero (ML) 9001-12000
    Hero (MM) 12001-15000
    Hero (MH)15001-18000
    Hero (HL)21001-24000
    Hero (HM)24001-27000
    Hero (HH)27001-30000

    Also there are some proprieties:
    -If a player kills someone with the same alignment as them, they'll he dropped down an AP level.
    For example... If Bob (Hero (LH) 7509) kills another Hero, he'll immediately drop to Hero (LM) 3001
    -If a player kills an enemy (like a giant spider or something) his AP will increase (+200)

  5. #5
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by AliGamer911 View Post
    That was the original plan, but then I realized that I needed to pay €50 (~$60) a year to keep my server running. That means I'm paying money to HIM to create content to keep HIS app alive... I've seen scummy people before, but this takes the cake.


    Thank you!

    - - - Updated - - -

    But if I may...

    My alignment thing is kinda inspired by Ol' West's...

    I'm trying to code for ~5 groups each with they're own AP levels... (For example

    Hero (LL) AP: 0-3000
    Hero (LM) AP: 3001-6000
    Hero (LH) AP: 6001-9000
    Hero (ML) 9001-12000
    Hero (MM) 12001-15000
    Hero (MH)15001-18000
    Hero (HL)21001-24000
    Hero (HM)24001-27000
    Hero (HH)27001-30000

    Also there are some proprieties:
    -If a player kills someone with the same alignment as them, they'll he dropped down an AP level.
    For example... If Bob (Hero (LH) 7509) kills another Hero, he'll immediately drop to Hero (LM) 3001
    -If a player kills an enemy (like a giant spider or something) his AP will increase (+200)
    What do you have so far?


    I saw. I conquered. I came.


  6. #6
    Player Abdullah1441's Avatar
    Join Date
    May 2015
    Location
    California
    Posts
    6,937
    Quote Originally Posted by Grief Hero View Post
    What do you have so far?
    Building wise? Trying to build to the village where the game starts off in (this will be the tutorial level), build in each version, I run out of room (width wise), so I scrap it, and start anew... (how to increase map size .-.)

  7. #7
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by AliGamer911 View Post
    Building wise? Trying to build to the village where the game starts off in (this will be the tutorial level), build in each version, I run out of room (width wise), so I scrap it, and start anew... (how to increase map size .-.)
    Levels are only 64x64 tiles, so if you want a larger map, you’ll need to make a GMAP.
    But what I meant was, you said you’re trying to code for 5 groups, so I was wondering what you had so far as a script.


    I saw. I conquered. I came.


  8. #8
    Gang and Level Team Keir's Avatar
    Join Date
    Aug 2018
    Posts
    131
    Quote Originally Posted by AliGamer911 View Post
    That was the original plan, but then I realized that I needed to pay €50 (~$60) a year to keep my server running. That means I'm paying money to HIM to create content to keep HIS app alive... I've seen scummy people before, but this takes the cake.
    Server hosting is an actual service though, people host the server for you with machines built for that and you pay them. Many games allow you to own your own server either by renting one or hosting one yourself, but most games these days only let you rent dedicated servers.

  9. #9
    Player Abdullah1441's Avatar
    Join Date
    May 2015
    Location
    California
    Posts
    6,937
    Quote Originally Posted by Grief Hero View Post
    Levels are only 64x64 tiles, so if you want a larger map, you’ll need to make a GMAP.
    But what I meant was, you said you’re trying to code for 5 groups, so I was wondering what you had so far as a script.
    I think I should scrap the ranking system for now, as it's too complex to code at the moment.
    Quote Originally Posted by Keir View Post
    Server hosting is an actual service though, people host the server for you with machines built for that and you pay them. Many games allow you to own your own server either by renting one or hosting one yourself, but most games these days only let you rent dedicated servers.
    That's not how I'm viewing price tag, but you made a point.

  10. #10
    Gang and Level Team Keir's Avatar
    Join Date
    Aug 2018
    Posts
    131
    Quote Originally Posted by AliGamer911 View Post
    That's not how I'm viewing price tag, but you made a point.
    The price is actually pretty good, most server renting sites sell per month and usually around £10-15+ per month. So that price for a year is pretty good.

    Quote Originally Posted by AliGamer911 View Post
    I think I should scrap the ranking system for now, as it's too complex to code at the moment.
    I woundn't scrap it, Grief is definitely a guy that can help you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •