Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-22-2008, 09:26 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Onwall-Check

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  
setTimer(0.05);
}
function 
onTimeOut() {
  for (
temp.04i++) { 
    if (!
keydown(i)) 
      continue;
    
temp.nOnwall true
    for (
temp.08n++) { 
      for (
temp.= -11+= 16) { 
        
temp.onwall onwall(player.1.5 vecx(player.dir) * 17 16 abs(vecy(player.dir)) * kplayer.vecy(player.dir) * 17 16 abs(vecx(player.dir)) * k);  
        if (
temp.onwall) { 
          
temp.nOnwall false
          break; 
        } 
      } 
       if (
temp.nOnwall) { 
        
player.+= vecx(player.dir) * 1/16
        
player.+= vecy(player.dir) * 1/16
      } 
    } 
  }  
  
setTimer(0.05);  

Hello.. some people told me that this script is not logical and that I have to do this and that. But no one has ever told me WHY it is not logical or WHAT my mistake is.
I dont want you to rescript this or anything like that.
Please tell me what wrong is Thanks.

Last edited by Pelikano; 11-22-2008 at 10:26 PM..
Reply With Quote
  #2  
Old 11-22-2008, 09:51 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
So why don't you tell us what you're trying to do.
__________________
Reply With Quote
  #3  
Old 11-22-2008, 09:53 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
I am trying to change the speed of the player and scripting my own onwall check? lol.
Reply With Quote
  #4  
Old 11-22-2008, 10:03 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Pelikano View Post
I am trying to change the speed of the player and scripting my own onwall check? lol.
Well then explain the script so people don't have to spend time to figure out what you're doing.
__________________
Reply With Quote
  #5  
Old 11-22-2008, 10:27 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
If you really want to help me you'll first read the script once.
And if you read the script once and your IQ is over 40 you'll understand it.
Reply With Quote
  #6  
Old 11-22-2008, 10:36 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Pelikano View Post
If you really want to help me you'll first read the script once.
And if you read the script once and your IQ is over 40 you'll understand it.
If you really want someone to help you then I suggest not being insulting.

And I don't "really" want to help you, however I don't mind helping if you explain some of the calculations.
__________________
Reply With Quote
  #7  
Old 11-22-2008, 11:03 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
Why are you using abs() on some of your vectors?
__________________
Reply With Quote
  #8  
Old 11-23-2008, 12:34 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Quote:
Originally Posted by Chompy View Post
Why are you using abs() on some of your vectors?
Instead of (player.dir in |0,2| ? k : 0) I use abs(vecy(player.dir)*k, because then vecy gives out 0 or 1, if it gives out 1 the player.dir is either 0 or 2, it's exactly the same as "(player.dir in |0,2| ? k : 0)".
Reply With Quote
  #9  
Old 11-23-2008, 02:45 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
Yeah, but using if (player.dir in |0,2| ? k : 0) would give you the variable k if you are facing down, left and up..

As |0,2| doesn't mean 0 or 2, it means 0, 2 and anything between.

And do you know what vectors are? And how they work? And could you tell me why you are using 17/16 in your onwall calculations?
Because.. 17 divided by 16 is 1.0625 and in the long go it will eventually jump over a few tiles to check..
__________________
Reply With Quote
  #10  
Old 11-23-2008, 03:28 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
Quote:
Originally Posted by Chompy View Post
Yeah, but using if (player.dir in |0,2| ? k : 0) would give you the variable k if you are facing down, left and up..

As |0,2| doesn't mean 0 or 2, it means 0, 2 and anything between.

And do you know what vectors are? And how they work? And could you tell me why you are using 17/16 in your onwall calculations?
Because.. 17 divided by 16 is 1.0625 and in the long go it will eventually jump over a few tiles to check..
The |a, b| thing is a mistake I suppose. He's still quite new to coding. I explained him how vectors work, and using 17 / 16 will result in checking almost exactly one pixel out of the bounding box of the player.
Reply With Quote
  #11  
Old 11-23-2008, 03:30 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
Quote:
Originally Posted by Crow View Post
The |a, b| thing is a mistake I suppose. He's still quite new to coding. I explained him how vectors work, and using 17 / 16 will result in checking almost exactly one pixel out of the bounding box of the player.
Well, he were asking us at the Tesbed Server and wasn't very.. co-working.. or whatever the word is But yeah, I'm still wondering what he is trying to do exactly.. And I don't like how he responded in post #5.
__________________
Reply With Quote
  #12  
Old 11-23-2008, 03:38 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
Quote:
Originally Posted by Chompy View Post
Well, he were asking us at the Tesbed Server and wasn't very.. co-working.. or whatever the word is But yeah, I'm still wondering what he is trying to do exactly.. And I don't like how he responded in post #5.
He can a jerk like that, yea. Guess the next thing I will tell him is how to post on the scripting forums
He's trying to do either a custom movement or some addition to the default one (running or so). Cant remember.
Reply With Quote
  #13  
Old 11-23-2008, 07:46 PM
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 Pelikano View Post
I am trying to change the speed of the player and scripting my own onwall check? lol.
Quote:
Originally Posted by Pelikano View Post
If you really want to help me you'll first read the script once.
And if you read the script once and your IQ is over 40 you'll understand it.
It's generally a good rule of thumb to respect the scripters who are better than you and willing to help you with your problems.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #14  
Old 11-23-2008, 08:27 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Just for the record, my I.Q. is 130.
__________________
Reply With Quote
  #15  
Old 11-24-2008, 02:32 AM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by Inverness View Post
Just for the record, my I.Q. is 130.
You're so smart; I admire you.
Reply With Quote
  #16  
Old 11-24-2008, 03:43 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
It's over 9000!!!!!!!
Reply With Quote
  #17  
Old 11-24-2008, 09:53 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Quote:
Originally Posted by Inverness View Post
Just for the record, my I.Q. is 130.
Congratulations.


Okay I am making my own movement system.
I add 17/16 because 1/16 = pixel, so 17/16 = 1 pixel more than a tile.
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 01:11 PM.


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