Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-22-2009, 10:46 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
onwall2

Works just fine in levels
Returns "true" constantly on gmaps Or maybe just gmaps with tiledef type 1?
wtf?
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233

Last edited by Tyhm; 02-22-2009 at 11:12 AM..
Reply With Quote
  #2  
Old 02-22-2009, 03:34 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Tried %64 on the first two input values?
__________________
Reply With Quote
  #3  
Old 02-22-2009, 04:25 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
hmm- it should work @ Tyhm...
Reply With Quote
  #4  
Old 02-22-2009, 08:19 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
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?
Reply With Quote
  #5  
Old 02-22-2009, 09:04 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 Tyhm View Post
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.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 02-22-2009, 11:06 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
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.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233

Last edited by Tyhm; 02-23-2009 at 12:44 AM.. Reason: oops, left the debug code in
Reply With Quote
  #7  
Old 02-23-2009, 12:12 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
PHP Code:
if(onwall2(x+tx-1,y+ty-1,2,2)&&false){ 
I don't get '&&false' are you trying '==false' maybe?
__________________
Deep into the Darkness peering...
Reply With Quote
  #8  
Old 02-23-2009, 12:23 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
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...
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #9  
Old 02-23-2009, 07:07 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
'x' as in the position of the object or a set var? if a var please post
Reply With Quote
  #10  
Old 02-23-2009, 07:12 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
position of the object, modified (in theory) by the move command later on.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #11  
Old 02-25-2009, 06:33 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
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?
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #12  
Old 02-25-2009, 12:32 PM
Riot-Starter Riot-Starter is offline
Registered User
Join Date: Aug 2001
Location: Central Florida, USA
Posts: 79
Riot-Starter is on a distinguished road
Send a message via AIM to Riot-Starter
Quote:
Originally Posted by Tyhm View Post
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
Reply With Quote
  #13  
Old 02-25-2009, 02:53 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
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...
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233

Last edited by Tyhm; 02-25-2009 at 05:03 PM..
Reply With Quote
  #14  
Old 02-26-2009, 10:18 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
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?
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233

Last edited by Tyhm; 02-26-2009 at 12:56 PM..
Reply With Quote
  #15  
Old 02-26-2009, 03:43 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Quote:
Originally Posted by Riot-Starter View Post
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.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
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 09:17 AM.


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