Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Old Scripting Engine (GS1)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #22  
Old 03-18-2018, 08:12 PM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
We did the same thing on delteria but I like your method you did with the array regarding setShape2 I did that aswell. Also use [PHP] tags instead of code tags looks much cleaner.


PHP Code:
//#CLIENTSIDE
function onCreated() {
  
with (findimg(200)) {
    
this.image thiso.bridgeImage;
    
this.layer  1;
    
this.thiso.x;
    
this.thiso.y;
    
this.mode  1;
    
this.alpha 0.75;

    if (
thiso.direction == "vertical")
      
this.+= 2;
    else
      
this.+= 2;
  }

  
this.bridgeWidth  getImgWidth(this.bridgeImage) / 16;
  
this.bridgeHeight getImgHeight(this.bridgeImage) / 16;
  
this.this.bridgeWidth  + (this.direction == "horizontal" 0);
  
this.this.bridgeHeight + (this.direction == "vertical" 0);

  
// 10 16
  // 10 21

  
this.dontBlock();

  
onTimeOut();
}

function 
onBridge(temp.py) {
  if (
player.x in |this.xthis.this.w|) {
    if (
temp.py in |this.ythis.this.h|)
      return 
true
  }

  return 
false;
}

function 
isPlayerEntering(temp.py) {
  if (
player.x in |this.xthis.this.w|) {
    if (
temp.py in |this.ythis.2|)
      return 
true;

    if (
temp.py in |this.this.2this.this.h|)
      return 
true;    
  }

  return 
false;
}

function 
onTimeOut() {
  
temp.py player.vecy(player.dir) * 1.05;

  
temp.entered isPlayerEntering(temp.py);

  if (
temp.entered) {
    if (
player.attached == false) {
      
attachPlayerToObj(0this.id);
      
setshape2(this.wthis.hthis.shape);
    }
  } else if (
player.attached == true && player.attachid == this.id) {
    if (
onBridge(temp.py)) {
    } else {
      
detachplayer();  
    }
    
this.chat "attached";
  } else {
    
this.chat "na";
  }

  
setTimer(0.05);

__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
 


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 01:10 PM.


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