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 03-31-2001, 07:50 AM
Grey_Mage Grey_Mage is offline
Registered User
Join Date: Mar 2001
Location: Graal
Posts: 72
Grey_Mage is on a distinguished road
Send a message via AIM to Grey_Mage Send a message via Yahoo to Grey_Mage
Question

How would you make onwall detection for this script?



if (created||timeout) {
if (this.active==1) {
//movement script
if (keydown(0)) {
playery-=0.5;
playerdir = 0;
}
if (keydown(1)) {
playerx-=0.5;
playerdir = 1;
}
if (keydown(2)) {
playery+=0.5;
playerdir = 2;
}
if (keydown(3)) {
playerx+=0.5;
playerdir = 3;
}
setani fglev,l;
disabledefmovement;
}
//Activating or deactivating script.
if (keydown(4)) {
if (this.pressed==0) {
enabledefmovement;
if (this.active==0)
this.active=1;

else

this.active=0;
this.pressed=1;

this.pressed=1;
}
}
else {
this.pressed=0;
}
timeout = 0.05;
}
__________________

Quote:
Mess with the best, die like the rest...
Reply With Quote
  #2  
Old 03-31-2001, 09:06 PM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
You could change your movement things so they look like this:
NPC Code:

if (keydown(1)&&!onwall(playerx,playery+1.5) {
playerx-=0.5;
playerdir = 1;
}



the playerx, and playery+1.5 are the co-ordinates where it looks to see if its onwall, do same for other directions, changing the co-ordinates of the onwall for each... or you can add something like this:
NPC Code:

if (keydown(1)&&onwall(playerx,playery+1.5) {
playerx+=0.3;
playerdir = 1;
}


this'll just bounce him back if in the wall, but youll have to have the original movement script as well.

Reply With Quote
  #3  
Old 03-31-2001, 11:08 PM
Grey_Mage Grey_Mage is offline
Registered User
Join Date: Mar 2001
Location: Graal
Posts: 72
Grey_Mage is on a distinguished road
Send a message via AIM to Grey_Mage Send a message via Yahoo to Grey_Mage
Talking Thx

Thanks that worked!
ummmmmm... How would you make it do ollieskateboard.gani while on it like press S and it plays it and then goes back to skateboard.gani... fir the same script... When I tried it it froze me...
__________________

Quote:
Mess with the best, die like the rest...

Last edited by Grey_Mage; 03-31-2001 at 11:34 PM..
Reply With Quote
  #4  
Old 04-02-2001, 12:46 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
I cant remember what keydown s is... maybe 5? If wrong just change it... also, for this to work you will have to have disabledefmovement on
NPC Code:

if (keydown(5)&&timeout) {
setani ollieskateboard,;
// have the gani not loop, and get the aproximite time of it for the following sleep
sleep 1;
setani skateboard,;
}



There, thats a simple way, also if you wanted you could at params to the gani to make diffent style skateboards and colours... just a thought
Reply With Quote
  #5  
Old 04-02-2001, 01:13 AM
RawPower RawPower is offline
Godd Bye
RawPower's Avatar
Join Date: Mar 2001
Location: Canada
Posts: 3,554
RawPower is on a distinguished road
Send a message via ICQ to RawPower Send a message via AIM to RawPower
>=\\

You copied our skateboard !
__________________
Farewell graalians...
Reply With Quote
  #6  
Old 04-02-2001, 09:46 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
Grey_Mage did? bad...
Reply With Quote
  #7  
Old 04-04-2001, 12:57 AM
Cloud_X Cloud_X is offline
Cloud_X's Avatar
Join Date: Mar 2001
Posts: 2,921
Cloud_X will become famous soon enough
Stop stealing shadrock's gani's!
Only i can do that i mean ummm.....*runs away*
__________________
Temporary blocked
Stefan Knorr
Reply With Quote
  #8  
Old 04-05-2001, 07:43 AM
Grey_Mage Grey_Mage is offline
Registered User
Join Date: Mar 2001
Location: Graal
Posts: 72
Grey_Mage is on a distinguished road
Send a message via AIM to Grey_Mage Send a message via Yahoo to Grey_Mage
Red face Nah!

Nah I didn't steal your skateboard I am trying to make one from scratch!
__________________

Quote:
Mess with the best, die like the rest...
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 01:56 AM.


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