Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-28-2009, 03:21 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
onwall visual indicator

(GS1 script)
intended for use while level editing, this draws a line where the player is onwall on any side of them. such as using those little stone and mushroom tiles in the middle of a field where the player would be blocked in what looks like theres an open pathway (grrrr) you can walk through with this and find such places

i checked to make sure the x and y locations are precise for player movement (so you can use that for other stuff too maybe)

could probably be easily converted to gs2

PHP Code:
// NPC made by Prozac
if (created) {toweapons walltesttimeout=.05;}

if (
timeout)
{

//above, dir=0
if (onwall(playerx+.5,playery)
   || 
onwall(playerx+1.5,playery)
   || 
onwall(playerx+2,playery)
   )
{
showpoly 1,{playerx,playery+.5,playerx+3,playery+.5};}
else {
hideimg 1;}

//right, dir=1
if (onwall(playerx+2.5,playery+1)
   || 
onwall(playerx+2.5,playery+1.5)
   || 
onwall(playerx+2.5,playery+2)
   || 
onwall(playerx+2.5,playery+2.5)
   )
{
showpoly 2,{playerx+2.5,playery,playerx+2.5,playery+3};}
else {
hideimg 2;}

//below, dir=2
if (onwall(playerx+.5,playery+3)
   || 
onwall(playerx+1.5,playery+3)
   || 
onwall(playerx+2,playery+3)
   )
{
showpoly 3,{playerx,playery+3,playerx+3,playery+3};}
else {
hideimg 3;}

//left, dir=3
if (onwall(playerx,playery+1)
   || 
onwall(playerx,playery+1.5)
   || 
onwall(playerx,playery+2)
   || 
onwall(playerx,playery+2.5)
   )
{
showpoly 4,{playerx+.5,playery,playerx+.5,playery+3};}
else {
hideimg 4;}

timeout=.05;

Reply With Quote
  #2  
Old 06-28-2009, 04:22 AM
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
I'm tempted to delete this thread due to GS1 :'( Makes for a new rule, actually.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 06-28-2009, 05:02 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
whaa? its for use when editing levels, as in, while making stuff to upload but your level is not online yet ... thats why its in gs1 ... gs2 does not work in level editor so it HAS to be in gs1
Reply With Quote
  #4  
Old 06-28-2009, 05:29 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by http://forums.graalonline.com/forums/showthread.php?t=68640
please also mark any threads with "gs1" in the subject if your script is using the old scripting engine.
^ ^ ^
Reply With Quote
  #5  
Old 06-28-2009, 05:34 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
Quote:
Originally Posted by DustyPorViva View Post
note gs1 in subject
i meant to but forgot .. i tried to edit the thread afterwards but it would not let me change the subject line
Reply With Quote
  #6  
Old 06-28-2009, 06:06 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Looking back on GS1, I don't know how we ever got a long without sending parameters to our own functions.. but I don't see how useful this actually is
__________________
Quote:
Reply With Quote
  #7  
Old 06-28-2009, 06:07 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Kaimetsu once made a script that outlined all walls with a line(polygon). Pretty cool, actually
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 11:03 AM.


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