Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   onwall2 (https://forums.graalonline.com/forums/showthread.php?t=84350)

Tyhm 02-22-2009 10:46 AM

onwall2
 
Works just fine in levels
Returns "true" constantly on gmaps Or maybe just gmaps with tiledef type 1?
wtf?

Chompy 02-22-2009 03:34 PM

Tried %64 on the first two input values?

[email protected] 02-22-2009 04:25 PM

hmm- it should work @ Tyhm...

Crow 02-22-2009 08:19 PM

It does work on gmaps, I'm completely sure about that, since I have used onwall2() in Era's movement system. Maybe post your code here so I/we can take a look at it?

xXziroXx 02-22-2009 09:04 PM

Quote:

Originally Posted by Tyhm (Post 1468571)
Works just fine in levels
Returns "true" constantly on gmaps Or maybe just gmaps with tiledef type 1?
wtf?

Bear in mind that x32, y32 on a gmap will always be x32 y32 in the upper left corner level, and not x32 y32 in the current level.

Tyhm 02-22-2009 11:06 PM

Relevant bit:
PHP Code:

  temp.h=10;//really it's the distance to the player
      
for(temp.v=0;v<h;v++){
        
temp.tx=v*(dx/h);
        
temp.ty=v*(dy/h);
        
//        showpoly(0,{x+tx-1,y+ty-1,x+tx+1,y+ty-1,x+tx+1,y+ty+1,x+tx-1,y+ty+1});
        
showimg(0,x+tx-1,y+ty-1,"insomshotgun-icon.png");
        
//doesn't work on a GMAP:
        
if(onwall2(x+tx-1,y+ty-1,2,2)){
          if(
v<1){
            
temp.startedonwall=true;            
//this.chat="Started on wall:";
          
}else{
            
this.chat=(this.chat@" and found one at "@(x+tx-1)@","@(y+ty-1)@" ("@((x+tx-1)%64)@", "@((y+ty-1)%64)@")");
            if(
startedonwallv=-1;
            else 
v--;
            
h=0;
          }
        }else if(
v>0temp.startedonwall=false;
      }
      
      if (
v<this.r){
        
setTimer(2);
//        message("Idle 2: v<this.r");
      
}else if (startedonwall){
        
setTimer(2);
//        message("Idle 2: startedonwall");
        //hurt the player or:
        //glomp the ally happens on acquiretarget
      
}else{
        
temp.tt=(v*this.speed*0.5)+(hearts/20);
        
move tx,ty,tt,24;
        
setTimer(1+tt);
//        message("Move "@1+tt);
      


Works fine on an inside level built with the default tileset, fails on an outside level built with the newtype tiledef.
Also it should be noted the NPC in question has dontblock(); and setshape 0 by 0, just to make sure it won't block itself.

Angel_Light 02-23-2009 12:12 AM

PHP Code:

if(onwall2(x+tx-1,y+ty-1,2,2)&&false){ 

I don't get '&&false' are you trying '==false' maybe?

Tyhm 02-23-2009 12:23 AM

Oops;
&false is debug - means "never actually check this", as that part of the code is currently disabled. Editing previous post so you can see what it looked like when it worked as described...

[email protected] 02-23-2009 07:07 PM

'x' as in the position of the object or a set var? if a var please post

Tyhm 02-23-2009 07:12 PM

position of the object, modified (in theory) by the move command later on.

Tyhm 02-25-2009 06:33 AM

You know, it's possible I'm just botching the addtiledef; doesn't it have to be called serverside somewhere so the Server knows what set of onwalls and onwaters you're using? I mean, clientside sure, it can figure it out based on what the player's tiledefs are, but do I have to add a line to the server options or the control NPC or every script that asks for serverside onwall?

Riot-Starter 02-25-2009 12:32 PM

Quote:

Originally Posted by Tyhm (Post 1469278)
You know, it's possible I'm just botching the addtiledef; doesn't it have to be called serverside somewhere so the Server knows what set of onwalls and onwaters you're using? I mean, clientside sure, it can figure it out based on what the player's tiledefs are, but do I have to add a line to the server options or the control NPC or every script that asks for serverside onwall?

You probably need to add newtilesets=true (or newtilesetlevels) to the server options.

http://graal.net/index.php/Server_options#Tilesets

Tyhm 02-25-2009 02:53 PM

Bugger. Thank you, that answers my question perfectly. And newtilesets=true is right there in the serveroptions, and the problem persists. I'll make a test weapon that lights up everything it considers onwall serverside, see if I can figure it out...

...well, that went disasterously. Not only are all conceivable output methods clientside only (making a "Quick and easy" serverside-onwall-checker neither quick nor easy), but my best effort returned with the conclusion that every single tile on even the test levels is a wall, a conclusion not even the zombie NPC came up with...

Tyhm 02-26-2009 10:18 AM

Furthering The Mystery:

When these zombies are placed at 32,32 on level a_01 of a tiledef2 gmap'd map, they find walls everywhere.

When the exact same level is renamed so that it's no longer a tiledef or a gmap, they work fine

When the exact same level is renamed so that it's STILL A TILEDEF but NOT a gmap, they work fine!

onwall2 just won't work on a gmap! Wtf!?


Further Still:
PHP Code:

function onCreated() {
  
setTimer(1);
}
function 
onTimeOut() {
  
Find_A_Wall();
  
setTimer(1);
}
function 
Find_A_Wall() {
  if( 
onwall2player.xplayer.y1) )
  {
    
player.chat "EEK I found A Wall!";
   
// echo("Found a Wall");
  
}
  else
  {
    
player.chat "I'd not find a Wall.";
    echo(
"Did not found a Wall");
  }


After 3 hours of tinkering we made the simplest possible script. It never echoes that it did not find a wall. Ever. (though Found A Wall goes off constantly...) But not even when we give it an abitrary X and Y...did Stefan just disable onwall2 and not tell any of us?

Tyhm 02-26-2009 03:43 PM

Quote:

Originally Posted by Riot-Starter (Post 1469306)
You probably need to add newtilesets=true (or newtilesetlevels) to the server options.

http://graal.net/index.php/Server_options#Tilesets

LOLZ, NEVERMIND EVERYONE, THE SERVER OWNER FORGOT THE S. HE HAD NEWTILESET=TRUE, THAT WAS THE PROBLEM.

Thank you all for your kind indulgence.

Deas_Voice 03-03-2009 09:07 PM

Quote:

Originally Posted by Tyhm (Post 1469603)
Furthering The Mystery:

When these zombies are placed at 32,32 on level a_01 of a tiledef2 gmap'd map, they find walls everywhere.

When the exact same level is renamed so that it's no longer a tiledef or a gmap, they work fine

When the exact same level is renamed so that it's STILL A TILEDEF but NOT a gmap, they work fine!

onwall2 just won't work on a gmap! Wtf!?


Further Still:
PHP Code:

function onCreated() {
  
setTimer(1);
}
function 
onTimeOut() {
  
Find_A_Wall();
  
setTimer(1);
}
function 
Find_A_Wall() {
  if( 
onwall2player.xplayer.y1) )
  {
    
player.chat "EEK I found A Wall!";
   
// echo("Found a Wall");
  
}
  else
  {
    
player.chat "I'd not find a Wall.";
    echo(
"Did not found a Wall");
  }


After 3 hours of tinkering we made the simplest possible script. It never echoes that it did not find a wall. Ever. (though Found A Wall goes off constantly...) But not even when we give it an abitrary X and Y...did Stefan just disable onwall2 and not tell any of us?

bump this quote, i would like to know also.

Codein 03-03-2009 09:25 PM

Quote:

Originally Posted by Deas_Voice (Post 1471033)
bump this quote, i would like to know also.

The problem Thym was having lies with this server option:

HTML Code:

newtilesets=true
It was misspelt at the time. The above is the fixed version.

Are you sure you've spelt this correctly?


All times are GMT +2. The time now is 04:19 PM.

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