Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   onwall visual indicator (https://forums.graalonline.com/forums/showthread.php?t=86579)

Prozac 06-28-2009 03:21 AM

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;



Tigairius 06-28-2009 04:22 AM

I'm tempted to delete this thread due to GS1 :'( Makes for a new rule, actually.

Prozac 06-28-2009 05:02 AM

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

DustyPorViva 06-28-2009 05:29 AM

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.

^ ^ ^

Prozac 06-28-2009 05:34 AM

Quote:

Originally Posted by DustyPorViva (Post 1502289)
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

fowlplay4 06-28-2009 06:06 AM

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 :(

DustyPorViva 06-28-2009 06:07 AM

Kaimetsu once made a script that outlined all walls with a line(polygon). Pretty cool, actually :)


All times are GMT +2. The time now is 07:00 AM.

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