Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-14-2006, 11:17 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
my hammer broke

I used the hammer from the scripts in the Graal folder (made by stefan)
Modified it a bit (slightly) and reformatted it. It used to work, now it doesn't. The RC and I cannot find any problems in it, any help?
PHP Code:
//#CLIENTSIDE
if (playerenters || created) {
  
hideimg 1;
  
this.step 0;
  
timeout 0;

}
if (
weaponfired && this.step<=0) {
  
hideimg 1;
  
hidesword 0.5;
  
freezeplayer 0.5;

  
timeout 0.05;
  
this.step 0;
}
if (
timeout
{
  
this.step++;
  if (
this.step<10
  {
    if (
this.step<3
    {
      if (
playerdir==0
      {
         
playersprite 11;
       }
      else if (
playerdir==2)
      {
         
playersprite 6;
      }
      else
      {
        
playersprite 9;
      }
    } 
  else 
  {
      if (
playerdir==0)
      {
        
playersprite 10;
      }
      else if (
playerdir==2)
      {
        
playersprite 11;
      }      
      else 
      {
        
playersprite 11;
      }
    }
  if (
this.step==6
    {
      
set teststake;
      
set testhurt;
    }
    if (
playerdir==0)
    {
      
showimg 1,wham0.gif,playerx-0.75,playery-1.7;
    }
    if (
playerdir==1)
    {
     
showimg 1,wham1.gif,playerx-1.7,playery-0.2;
    }
    if (
playerdir==2)
    {
      
showimg 1,wham2.gif,playerx+0.6,playery-0.4;
    }
    if (
playerdir==3)
    {
      
showimg 1,wham3.gif,playerx+1.5,playery-0.2;
    }
    
timeout 0.05;
  } 
  else
  {
    
playersprite 0;
    
hideimg 1;
    
this.step 0;
  }
}
if (
teststake
{
  unset 
teststake;
  
putx playerx 0.5;
  
puty playery 2;
  if (
playerdir==0
  {
    
puty -= 3;
  }
  if (
playerdir==1
  {
    
putx -= 2;
    
puty -= 0.5;
  }
  if (
playerdir==2)
  {
    
putx += 0.5;
    
puty += 1;
  }
  if (
playerdir==3
  {
    
putx += 2;
    
puty -= 0.5;
  }
  
putx int(putx);
  
puty int(puty);
  
set isstake;
  for (
this.i=0this.i<2this.i++)
  {
    for (
this.j=0this.j<2this.j++) 
    {
      
board[putx+i+64*(puty+this.j)];
      
bx 16;
      
by int(16);
      if (!(
bx==10+thisi && by==20+thisj) && !(bx==4+thisi && by==103+thisj))
        {
          unset 
isstake;
        }
    }
  }
  if (
isstake
  {
    unset 
isstake;
    
board[putx+64*puty] = 10+112*16;
    
board[putx+1+64*puty] = 11+112*16;
    
board[putx+64*(puty+1)] = 10+113*16;
    
board[putx+1+64*(puty+1)] = 11+113*16;
    
updateboard putx,puty,2,2;
    
play axe.wav;
  }
  else
  {
    
play arrowon.wav;
  }
}
if (
testhurt
{
  unset 
testhurt;
  
testx playerx+1.5;
  
testy playery+2;
  if (
playerdir==0)
  {
    
testy-=2;
  }
  if (
playerdir==1
  {
    
testx-=2;
  }
  if (
playerdir==2)
  {
    
testy+=2;
  }
  if (
playerdir==3)
  {
    
testx+=2;
  }
  for (
this.i=0this.i<compuscountthis.i++) 
  {
    if (
abs(testx-(compus[i].x+1))<=&& abs(testy-(compus[i].y+1))<=1.5 && compus[i].mode!=3)
    {
      
hitcompu i,3,testx,testy;
    }
  }
  for (
i=1i<playerscounti++) 
  {
    if (
abs(testx-(players[i].x+1.5))<=&& abs(testy-(players[i].y+2))<=1.5
    {
      
hitplayer i,2,testx,testy;
      
putleaps 2,testx-1,testy-1;
      
setplayerprop #c,Ha ha!;
    
}
  }

Reply With Quote
  #2  
Old 05-15-2006, 01:16 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
eww gs1. I dont see nothing wrong either
__________________
Deep into the Darkness peering...
Reply With Quote
  #3  
Old 05-15-2006, 01:44 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
I know, me either. Maybe I'll convert it to GS2
(btw, gs1 ain't so bad )
Reply With Quote
  #4  
Old 05-15-2006, 03:07 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
GS1 is good for making things look more complicated, thus making you seem smart. GS2 is more efficient though.
Reply With Quote
  #5  
Old 05-15-2006, 07:24 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
....So by this, I assume I should just translate it to GS2, and that should work? That sometimes happenes x_X
Reply With Quote
  #6  
Old 05-15-2006, 07:28 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by excaliber7388
playersprite = 11;
Are you kidding me.

The setting of non-client. flags is dodgy at best.
Reply With Quote
  #7  
Old 05-17-2006, 07:10 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
I thought that setting lpayersprite to 11 would litterally set the player's current sprite to 11. This NPC was obviouslydone without a Gani, and I could add one if this is the only problem.
Reply With Quote
  #8  
Old 05-17-2006, 09:53 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by excaliber7388
I thought that setting lpayersprite to 11 would litterally set the player's current sprite to 11. This NPC was obviouslydone without a Gani, and I could add one if this is the only problem.
The problem is that you're trying to fix a salvaged script made years and years ago.
__________________
Reply With Quote
  #9  
Old 05-18-2006, 12:48 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Loriel
Are you kidding me.

The setting of non-client. flags is dodgy at best.
But that is like setting player.sprite, is it not?

(NOTE: I am not advocating the use of player.sprite, but I am just pointing out that there are 'non-client. flags' that are OK to set.)
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #10  
Old 05-18-2006, 01:04 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by napo_p2p
But that is like setting player.sprite, is it not?

(NOTE: I am not advocating the use of player.sprite, but I am just pointing out that there are 'non-client. flags' that are OK to set.)
Uh, probably. It is doubly deprecated, then.
Reply With Quote
  #11  
Old 05-18-2006, 02:59 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
I guess the best thing to do would make a gani for this, take out the playersprite, and make it Gs2. Yay
Reply With Quote
  #12  
Old 05-28-2006, 10:00 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Okay, Now in GS2, but It still doesn't work. I don't understand how it's testing for a stake. I used the old script, which worked before for checking for stakes, but it doesn't seem to be working
PHP Code:
//#CLIENTSIDE
function onWeaponfired()
{
  
setani dr-hammer,;
  
this.putx playerx+.5+vecx(playerdir)*2;
  
this.puty playery+.75+vecy(playerdir)*2;
  for (
this.i=0this.i<2this.i++)
  {
    for (
this.j=0this.j<2this.j++) 
    {
      
board[this.putx+i+64*(this.puty+this.j)];
      
bx 16;
      
by int(16);
      if (!(
bx==10+this.&& by==20+this.j) && !(bx==4+this.&& by==103+this.j))
      {
          
this.isstake=0;
      }
      else
      {
        
this.isstake=1;
      }
    }
  }
  if (
this.isstake==1
  {
    
this.isstake=0;
    
board[putx+64*puty] = 10+112*16;
    
board[putx+1+64*puty] = 11+112*16;
    
board[putx+64*(puty+1)] = 10+113*16;
    
board[putx+1+64*(puty+1)] = 11+113*16;
    
updateboard putx,puty,2,2;
    
play("axe.wav");
  }
  else
  {
    
play("arrowon.wav");
  }

Reply With Quote
  #13  
Old 05-28-2006, 10:10 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Consider using setAni() instead of setani.
Reply With Quote
  #14  
Old 05-28-2006, 10:31 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
It makes no difference in the script for detecting stakes, but yeah.
Reply With Quote
  #15  
Old 05-29-2006, 03:53 PM
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
Quote:
Originally Posted by ZeLpH_MyStiK
The problem is that you're trying to fix a salvaged script made years and years ago.

Obey that, make a new hammer from scratch. Its S-I-M-P-L-E. No point intrying to fix a script made centuries ago.
__________________
Follow my work on social media post-Graal:Updated august 2025.
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 06:08 PM.


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