Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-12-2010, 03:37 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Non-Player Block

Is there any way to make the player none blocking? So the player is still there but you can walk through them (without making the level nopkzone)
__________________
Reply With Quote
  #2  
Old 06-12-2010, 03:56 PM
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
Nope
Reply With Quote
  #3  
Old 06-12-2010, 04:09 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Ah x-x

damn
__________________
Reply With Quote
  #4  
Old 06-12-2010, 04:52 PM
Entrok Entrok is offline
Registered User
Join Date: Sep 2009
Location: Sweden
Posts: 51
Entrok is on a distinguished road
Send a message via MSN to Entrok
Something like this?

Anti-Blocking Script

was posted 07-16-2007 by HolySheepy

Quote:
Originally Posted by HolySheepy View Post
Hi,

so there was this Spar Room, but outside of the Spar the people where annoyed because they were blocked by other people. So i made this script.

Credits
  • Misconception - for helping me with testing it
  • kc/KirbyZen - for helping me with testing it
  • Tortoise - for allowing me to make it public
  • The people on these forums, that told me to use player.level.name instead of player.level

This Script was made for Delteria and was first used there. But you can use it on your server if you want.

If you find any bugs, let me know.

This script was styled with the /style command of the rc, so don't blame me for styling :P

this.includelevels = if you have this.exmode = 1; this is a list of levels where the script will be enabled

this.excludelevels = if you have this.exmode = 0; this is a list of levels where the script will be disabled

this.disabledzones = a list of arrays
format for each array: { level, startx, starty, endx, endy }
if the players x and y are in startx/starty and endx/endy then the script will be disabled

Graal Script Code:
//#CLIENTSIDE
function onCreated() {
  
this.oldx = -1;
  
this.oldy = -1;
  
this.oldkeydown = { 000};
  
this.includelevels = { "kaljun_sparcomplexmain.nw" };
  
this.excludelevels = { };
  
this.disabledzones = { { "kaljun_sparcomplexmain.nw"17.51743.532 } };
  
this.exmode 1;
  
// Ex Modes:
  // 0 - Used in every Level except for those in this.excludelevels
  // 1 - Used only in Levels of this.includelevels
  
setTimer0.05 );
}
function 
onTimeout() {
  
this.speed player.shieldpower == 0.6 0.5;
  
this.modx = { 0, -this.speed0this.speed };
  
this.mody = { -this.speed0this.speed};
  
this.cmodx = { 000};
  
this.cmody = { 002};
  
this.mods = { "y""x""y""x" };
  if ( 
checkLevel() == true ) {
    if ( 
checkDisabled() == true) {
      
setTimer0.05 );
      return ;
    }
    for ( 
0this.modx.size(); i++ ) {
      if ( 
keydown) ) {
        if ( 
this.oldkeydown] == ) {
          
this.oldkeydown] = 1;
        } else {
          if ( 
this.(@ "old" this.mods] ) == player.(@ this.mods] )) {
            if ( !
onwall3player.0.5 this.modx], player.this.mody], 2) && testplayer2player.0.5 this.modx] + this.cmodx], player.this.mody] + this.cmody] ) != -) {
              if ( 
player.ani != "walk" ) {
                if ( 
player.ani == "grab" || player.ani == "pull" ) {
                  if ( 
keydown) ) {
                    
setTimer0.05 );
                    return ;
                  }
                }
                if ( 
checkTiletypesplayer.0.5 this.modx], player.this.mody], 22, { } ) == true ) {
                  
setani"sit""");
                }
                else if ( 
checkTiletypesplayer.0.5 this.modx], player.this.mody], 22, { 1112 } ) == true ) {
                  
setani"swim""" );
                }
                else {
                  
setani"walk""" );
                }
              }
              
player.+= this.modx];
              
player.+= this.mody];
            }
          }
        }
      } else {
        if ( 
this.oldkeydown] == )
          
this.oldkeydown] = 0;
      }
    }
  }
  
this.oldx player.x;
  
this.oldy player.y;

  
setTimer0.05 );
}

function 
checkDisabled() {
for ( 
czthis.disabledzones ) {
    if ( 
cz] == player.level.name ) {
      if ( 
player.x in cz], cz] | && player.y in cz], cz] | )
        return 
true;
    }
  }
  return 
false;
}

function 
checkLevel() {
  switch ( 
this.exmode ) {
    case 
0: {
        return ( !( 
player.level.name in this.excludelevels ) );
      }
      break;
    case 
1: {
        return ( 
player.level.name in this.includelevels );
      }
      break;
  }
  return 
false;
}

function 
onwall3startxstartycheckwcheckh ) {
  return ( 
checkTiletypesstartxstartycheckwcheckh, { 202122 } ) );
}

function 
checkTiletypesstartxstartycheckwcheckhtilec ) {
  
this.foundw 0;
  if ( 
tiletypestartxstarty in tilec ) {
    
this.foundw 1;
  }
  if ( 
this.foundw == ) {
    for ( 
cx startxcx startx checkwcx += 0.1 ) {
      for ( 
cy startycy starty checkhcy += 0.1 ) {
        if ( 
tiletypecxcy in tilec ) {
          
this.foundw 1;
          break;
        }
      }
    }
  }
  return ( 
this.foundw );
}

function 
testplayer2checkxchecky ) {
for ( 
pplayers ) {
    if ( 
player.id != p.id )
      if ( 
checkx in p.1.5p.| && checky in p.0.5p.| )
        return ( 
p.id );
  }
  return ( -
);

p.s.: maybe i will do some optimization and post a updated version
Reply With Quote
  #5  
Old 06-12-2010, 06:20 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
hmm, thanks. that's like a custom movement though
__________________
Reply With Quote
  #6  
Old 06-12-2010, 06:24 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Stefan really needs to implement:

player.blockagain() and player.dontblock()

Then a lot of door-blocking problems could be fixed and not require a GP to settle it.
__________________
Quote:
Reply With Quote
  #7  
Old 06-12-2010, 06:34 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Yeah, I agree
__________________
Reply With Quote
  #8  
Old 06-12-2010, 09:23 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by fowlplay4 View Post
Stefan really needs to implement:

player.blockagain() and player.dontblock()

Then a lot of door-blocking problems could be fixed and not require a GP to settle it.
Or better yet, player.setShape.
__________________
Reply With Quote
  #9  
Old 06-12-2010, 09:27 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
all of the above
__________________
Reply With Quote
  #10  
Old 01-13-2011, 07:44 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Pardon the necromancy, but did any player-(non)blocking functions get added since this post? Even something simple like clientside functions to control whether or not other players are blocking without having to declare the whole level a clientside nopkzone would be fantastic.
Reply With Quote
  #11  
Old 01-13-2011, 07:44 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Lance View Post
Pardon the necromancy, but did any player-(non)blocking functions get added since this post? Some clientside function to control whether or not other players are blocking without having to declare the whole level a clientside nopkzone would be fantastic.
To my knowledge, no they haven't.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #12  
Old 01-13-2011, 07:49 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
noplayeronwalls() doesn't even work clientside, it sucks :/
Reply With Quote
  #13  
Old 01-13-2011, 07:55 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Tigairius View Post
To my knowledge, no they haven't.
Drat!

Quote:
Originally Posted by DustyPorViva View Post
noplayeronwalls() doesn't even work clientside, it sucks :/
Even something simple like that (as long as I could toggle it on and off at will, anyway) would be fine for my purposes. Stefan, please add it!
Reply With Quote
  #14  
Old 01-13-2011, 08:07 AM
Cloven Cloven is offline
Delteria
Cloven's Avatar
Join Date: Dec 2006
Location: Florida, United States
Posts: 542
Cloven has a spectacular aura about
Send a message via AIM to Cloven
Quote:
Originally Posted by fowlplay4 View Post
Stefan really needs to implement:

player.blockagain() and player.dontblock()

Then a lot of door-blocking problems could be fixed and not require a GP to settle it.
Quote:
Originally Posted by cbk1994 View Post
Or better yet, player.setShape.
^The above pretty much sums it up. This would be very useful and help to make gameplay much more dynamic.
Reply With Quote
  #15  
Old 01-13-2011, 08:40 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Nice features. Please add.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 04:11 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.