Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-13-2010, 10:52 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
ladder script

hey i´m new in this forum and also got a question now xD

so how can i make a ladder script on playerworld? like:

function onPlayertouchsme () {
setani anifile,;
and here that the player will move up to the y1 <-> y2 i want
}


anyone can help me?
Reply With Quote
  #2  
Old 11-14-2010, 12:25 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
PHP Code:
//#CLIENTSIDE

function onCreated()
{

  
this.ladderImg = <ladderIMG>; // Replace <ladderIMG> with the ladder image you want to use surrounded by quotes
  
this.ladderIdle = <ladderANIidle>; // Replace <ladderANIidle> with the idle ladder gani you want to use, surrounded by quotes
  
this.ladderWalk = <ladderANIwalk>; // Replace <ladderANIwalk> with the walk/moving ladder gani you want to use, surrounded by quotes

  
setImgthis.ladderImg); // Sets the ladder image
  
setshape1getimgwidththis.ladderImg), getimgheightthis.ladderImg)); // This sets the shape of the ladder so the client can detect it better in my opinion

  
onTimeout(); // This will start the onTimeout Loop

}

function 
onTimeout()
{

  if ( 
player.1.5 in this.xthis.+ (  getimgwidththis.ladderImg) / 16)| &&
       
player.2.0 in this.ythis.+ ( getimgheightthis.ladderImg) / 16)|) // Checks to see if the player is on the ladder
  
{
 
    
player.onLadder true// We'll set this flag so we can know later on that the player is on the ladder
    
setanithis.ladderIdleNULL); // Sets the players gani to the idle ladder gani
    //You could also do player.dir = 0; and not use special ganis altogether, just us 'idle' and 'walk' (or 'walkslow')

  
}

  else
    
player.onLadder false// This tells the script later on that the player is NOT on the ladder

  
if ( player.onLadder// You don't have to do '== true' cause the if statement already checks if it's true or false
  
{

    
disableDefMovement(); // Disables the defualt Movement system so we can control the player's movement

    
for ( temp.0temp.4temp.+= 2)  // Cycles though the up and down arrow keycodes ( 0 - up, 2 - Down)
    
{

      if ( 
keydowntemp.k)) //If player pushes an arrow key this will catch it
      
{

        
setanithis.ladderWalkNULL): // Sets the players gani to the walking/moving ladder gani 
        
player.+= vecytemp.k) * 0.35// Moves the players Y coor only, 0.35 is the speed, normal speed is 0.5 or 8 pixels every 0.05 seconds
        // Vecy will return -1, 0, or 1. If temp.k is 0 then it will give -1, if temp.k is 1 or 3 it will give 0, If it's 2 then it will return 1

      
}
    }
  }

  else 
// This will be called when player.onLadder is false
    
enableDefMovement(); // Enables the default movement system, so the player can move normally again

  
setTimer0.05); // Will call onTimeout in 0.05 seconds


__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!

Last edited by MrOmega; 11-14-2010 at 12:51 AM..
Reply With Quote
  #3  
Old 11-14-2010, 12:34 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Ladders would be a lot easier if setshape2 allowed you to overwrite blocking tiles with nonblocking.
Reply With Quote
  #4  
Old 11-14-2010, 12:42 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Quote:
Originally Posted by DustyPorViva View Post
Ladders would be a lot easier if setshape2 allowed you to overwrite blocking tiles with nonblocking.
Yep, but we gotta make do with what we got.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #5  
Old 11-14-2010, 01:37 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
I would personally attach the player to the ladder, slow his/her movement speed while attached and then work from there.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 11-14-2010, 03:09 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
thx MrOmega. it worked except one little thing: when i climb it uses the idle. but when i stop climbing on ladder its fine (so i didnt mix up)
Reply With Quote
  #7  
Old 11-14-2010, 06:16 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Are this.ladderIdle and this.ladderWalk different ganis?
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #8  
Old 11-14-2010, 06:12 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
yes they are
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.