Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-23-2001, 05:16 PM
Knightoffrost Knightoffrost is offline
and Delph Inc.
Knightoffrost's Avatar
Join Date: Jul 2001
Location: Canada
Posts: 1,162
Knightoffrost is on a distinguished road
Send a message via ICQ to Knightoffrost Send a message via AIM to Knightoffrost Send a message via Yahoo to Knightoffrost
Gravity/Jump n Run

[ Delph Inc. ]
I have finished one of my little gravity/jump n run scripts...but I'm trying to make it so only one type of tile blocks you.
I've added in all the board script so 4 types of wall tiles don't block you but it stuffed the whole thing up.
Yes...you can now move up and down, left and right through these wall tiles...one thing though is that it doesn't let you go diagonal.
Also, now when you press the jump button whilst on a texture of these 4 tiles you just go up and don't come down. And when you hold down you come down.
It's very wierd and hard to explain. But I'm just wondering if anyone is out there who can speak my language and help me.

Thanks
__________________
Xerphier Dintch
Featuring
Reply With Quote
  #2  
Old 09-23-2001, 09:43 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
well I can only under some of what your saying...

the keydown part...

for that you have to do it in seperate if/thens...

I beleve you have it like this right now
Quote:
if(keydown(0)){
you do your coding for moving up
}elseif(keydown(1)){
you do your coding for left
}elseif(keydown(2)){
you do your coding for down
}elseif(keydown(4)){
you do your coding for right
}
well insted of using

elseif

all the time just use 4 if's

like this
Quote:
if(keydown(0)){
you do your coding for moving up
}
if(keydown(1)){
you do your coding for left
}
if(keydown(2)){
you do your coding for down
}
if(keydown(4)){
you do your coding for right
}
mabie if you posted your code I can help you a little more but that is all I can help you right now
__________________
Thanks,
-KJL
Reply With Quote
  #3  
Old 09-23-2001, 10:29 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
well if you use elseif
then your checking for 1 thing and if that thing is correct then it doesn't check for the rest...

yea you can make it shorter by using vecx and y

but I didn't think of that when I was typing it...
__________________
Thanks,
-KJL
Reply With Quote
  #4  
Old 09-23-2001, 10:53 PM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
What exactly is vecx and vecy? Perhaps I use a different term...
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #5  
Old 09-23-2001, 11:05 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
Quote:
Originally posted by Kaimetsu

Usually you don't need it to check the second thing. Like I said, they can be mutual exclusive.
well if you say

if(keydown(blah)){

}elseif(keydown(blah)){

}

ect like I think he did

then the guy wont go diaganal like he was describing
__________________
Thanks,
-KJL
Reply With Quote
  #6  
Old 09-23-2001, 11:46 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
if hes not making it diagonal then use elseif's
if hes making diagonal you need if (else you are going to do dual if checkings for keys .. stupid would just increase ur onwall crap)
also i never tried but if u wanna make 1 type of tile instead of using board use that new command in the new G2k1 2.1 the tiles(x,y) or something . I havent tested it but board is picky and needs whole numbers (no decimals) and tiles(x,y) might accept decimals (increasing the accuracy of your onwall)
=)
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #7  
Old 09-24-2001, 04:59 AM
Knightoffrost Knightoffrost is offline
and Delph Inc.
Knightoffrost's Avatar
Join Date: Jul 2001
Location: Canada
Posts: 1,162
Knightoffrost is on a distinguished road
Send a message via ICQ to Knightoffrost Send a message via AIM to Knightoffrost Send a message via Yahoo to Knightoffrost
[ Delph Inc. ]
Board works fine and I can walk through only the 4 tiles I have specified but not Diagonal.
I will try the keydown thing again...it didn't work before and I might try something like:
if (keydown(playerdir)) {
playerx+=vecx(playerx);
playery+=vecy(playery);
}

That would work wouldn't it?
Could you give me some more on this tile(x,y) thing?
Or is it just like the 'in' command?

Quote:
Originally posted by CyanideSR71
What exactly is vecx and vecy? Perhaps I use a different term...
vecx and vecy are commands that have split the old dirgo array into a horizontal array (x) and a vertical (y) array.
e.g.
vecx contains this array {0,-1,0,1}
and vecy contains {-1,0,1,0}

So if you're using vecx and your NPC/player is facing left, you would get the result -1.
__________________
Xerphier Dintch
Featuring

Last edited by Knightoffrost; 09-24-2001 at 05:03 AM..
Reply With Quote
  #8  
Old 09-24-2001, 05:06 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Ohhhh..... Gotcha!
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
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 05:46 PM.


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