Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-01-2008, 11:45 PM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
no idea how to do this

I've seen a lot of maze events where your screen is black, but you have the little circle around your character in which you can see. I want to get this effect, but have no idea how.

This is probably considered asking for scripts, but meh, I don't have a clue.
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #2  
Old 07-02-2008, 12:11 AM
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
Well, you could make a huge ass image :]

Just remember to compress it tho
__________________
Reply With Quote
  #3  
Old 07-02-2008, 12:21 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
You script polygons. It's actually fairly simple
You script a polygon circle around the player, then 'inverse' it by scripting in a polygon(in the same array!) rectangle the size of the screen.
Reply With Quote
  #4  
Old 07-02-2008, 12:42 AM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
I've never really touched the showpoly function (assuming that's what is to be used here?) except for 1 time and I couldn't figure out how to do it z.z
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #5  
Old 07-02-2008, 01:27 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
PHP Code:
showpoly(index, {x1y1x2y2x3y3x4y4etc}); 
I guess I should probably explain that a bit better.

PHP Code:
showpoly(index, {startxstartywidthxwidthyheightxheightystartxstarty}); 
In theory, that would create a perfect rectangle.

So, lets say we want to draw a poly across the upper half of the screen:
PHP Code:
showpoly(200, {00screenwidth0screenwidthscreenheight 320screenheight 32}); 
The first two: 0, 0 are declaring the poly should start at 0, 0 of the screen
Second two: screenwidth, 0 are saying that the next point of the poly should be at the edge of the players horizontal screen, and 0 (at the top of the screen). At this point we have a white line that goes across the very top of the entire screen.
Third two: screenwidth, screenheight / 2 - 32 are declaring that the next drawing point should be at the right edge of the screen at the bottom right of half of the screen. Now we have a triangle, so we'll add
Fourth two: 0, screenheight / 2 - 32 which tells the next line to draw to the far left of the screen, and half way down.

It doesn't require a fifth one because it automatically closes it back up by connecting the last one to the starting point.

There's also a showpoly2() which has a format like this:

PHP Code:
showpoly2(index, {x1y1z1x2y2z2x3y3z3x4y4z4etc}); 
If you want an actual circle around the screen it would probably be easier for you to just use an image and stretch it across the screen.

For example, you could use the image below and possibly do something like:
PHP Code:
with (findimg(200)) {
  
image "example.gif";
  
x0;
  
stretchx screenwidth;
  
stretchy screenheight 32;

Attached Images
 
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #6  
Old 07-02-2008, 01:38 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
The problem with an image is that customizing is pretty much thrown out the window. Not to mention stretching it would mean varying degrees of visibility, depending on how large the screen is.
Reply With Quote
  #7  
Old 07-02-2008, 01:44 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
Quote:
Originally Posted by DustyPorViva View Post
mean varying degrees of visibility
Oh good point, didn't even think of that. Well if it's absolutely necessary to do a circle you could do what Dusty suggested, it's just a bit complicated.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #8  
Old 07-02-2008, 01:55 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
Well I suppose it is possible to do with an image, by resizing it... but in the end he'd still have to script polygons around the image. I think that's more complicated than scripting a circle.
Reply With Quote
  #9  
Old 07-02-2008, 02:04 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
Quote:
Originally Posted by DustyPorViva View Post
Well I suppose it is possible to do with an image, by resizing it... but in the end he'd still have to script polygons around the image. I think that's more complicated than scripting a circle.
Probably, yeah.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #10  
Old 07-02-2008, 05:12 PM
Galdor Galdor is offline
░▒▓██▓▒░
Galdor's Avatar
Join Date: Feb 2004
Posts: 2,434
Galdor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond repute
you add a lot of black light effects (not just randomly places out tho) that fades away the closer you get.
__________________
Links
Draenin's Villains
Draenin's Quests

My Albums
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Reply With Quote
  #11  
Old 07-02-2008, 11:22 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
uh cant you just seteffect() the screen and show a layer 3 "light"? O_o
__________________
Reply With Quote
  #12  
Old 07-02-2008, 11:24 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 projectigi View Post
uh cant you just seteffect() the screen and show a layer 3 "light"? O_o
That doesn't really give the same effect.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #13  
Old 07-02-2008, 11:32 PM
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
Ya, when you do something like that, the light doesn't 'erase' the black. So if you have pure black, you won't actually see anything but a light.
Reply With Quote
  #14  
Old 07-04-2008, 12:37 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I just opened light4.png or w/e in paint and inverted it. Then I took that inverted image, stuck it in the middle of the screen and drew a black polygon around it.

Also, make the polygon depend on the image's size in case the image hasn't loaded or for whatever reason. (Use getimgwidth(), etc)
__________________
Do it with a DON!
Reply With Quote
  #15  
Old 07-04-2008, 04:48 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
One thing to be careful about: If the player goes into capture mode (ALT + 6 or whatever) this disappears with the right options selected.
__________________
Reply With Quote
  #16  
Old 07-04-2008, 06:37 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by cbk1994 View Post
One thing to be careful about: If the player goes into capture mode (ALT + 6 or whatever) this disappears with the right options selected.
Why would polygons be disabled with capture mode?
__________________
Do it with a DON!
Reply With Quote
  #17  
Old 07-04-2008, 06:44 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by zokemon View Post
Why would polygons be disabled with capture mode?
They are shown on the screen layer (4+), which is removed if you have "hide the interface while capturing".
__________________
Reply With Quote
  #18  
Old 07-04-2008, 11:29 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by cbk1994 View Post
They are shown on the screen layer (4+), which is removed if you have "hide the interface while capturing".
Why would you show it on layer 4? That's just stupid.
__________________
Do it with a DON!
Reply With Quote
  #19  
Old 07-04-2008, 03:01 PM
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 zokemon View Post
Why would you show it on layer 4? That's just stupid.
Not entirely. It really depends on what you're doing. Drawing it on layer 3 may cause drawing issues, depending on what kind of images you're showing in the level and such.
Reply With Quote
  #20  
Old 07-04-2008, 06:09 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by zokemon View Post
Why would you show it on layer 4? That's just stupid.
... so it doesn't lag behind as you move? Unless I'm missing the entire point ...
__________________
Reply With Quote
  #21  
Old 07-04-2008, 06:16 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
You said "attachtoowner" then you deleted your post .. in any case, this is how GK does it, so I just wanted to warn people ...

Go to the GK staff they are doing it wrong.
__________________
Reply With Quote
  #22  
Old 07-04-2008, 08: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 cbk1994 View Post
... so it doesn't lag behind as you move? Unless I'm missing the entire point ...
Lag behind? What are you talking about? o.o;;

I did an effect just like this some time ago with a 2400x2400 png compressed down to 71KB (Aeko made that png) and I just did something like this..

PHP Code:
with(findimg(200)) {
  
image "aeko-darkness.png";
  
player.2400/32 1;
  
player.2400/32 1;
  
layer 3;

__________________
Reply With Quote
  #23  
Old 07-04-2008, 08:50 PM
Galdor Galdor is offline
░▒▓██▓▒░
Galdor's Avatar
Join Date: Feb 2004
Posts: 2,434
Galdor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond repute
And the battle of the nerds continues! meanwhile you can just try my idea, sure it might be a little complicated to pull off, but I think it will work just fine and will also look very flashy.
__________________
Links
Draenin's Villains
Draenin's Quests

My Albums
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Reply With Quote
  #24  
Old 07-04-2008, 09:20 PM
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 Galdor View Post
And the battle of the nerds continues! meanwhile you can just try my idea, sure it might be a little complicated to pull off, but I think it will work just fine and will also look very flashy.
Way too much work for an effect he's not even looking for. Polygons aren't that complicated once you get the hang of it, and it would pay for him to just learn them anyways. They're really handy.
Reply With Quote
  #25  
Old 07-04-2008, 11:52 PM
Galdor Galdor is offline
░▒▓██▓▒░
Galdor's Avatar
Join Date: Feb 2004
Posts: 2,434
Galdor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond repute
Quote:
Originally Posted by DustyPorViva View Post
Way too much work for an effect he's not even looking for. Polygons aren't that complicated once you get the hang of it, and it would pay for him to just learn them anyways. They're really handy.
Yes Dusty polygons are all fine but... I imagine that being very unimpressive looking.
Just like the black and white picture suggestion, but if you used something that looks like "light2.png" it would have been cooler looking as it has a nifty fade into it.

I'm guessing the thing I suggested would look very similar to the darkness effect in four sword adventures, and that darkness looks awesome.
__________________
Links
Draenin's Villains
Draenin's Quests

My Albums
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Reply With Quote
  #26  
Old 07-04-2008, 11:59 PM
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
In order to do anything that looks smooth it would take a huge amount of effects.
Reply With Quote
  #27  
Old 07-05-2008, 12:28 AM
Rufus Rufus is offline
Registered User
Join Date: Jun 2004
Location: United Kingdom
Posts: 4,698
Rufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud of
Quote:
Originally Posted by Galdor View Post
Yes Dusty polygons are all fine but... I imagine that being very unimpressive looking.
Just like the black and white picture suggestion, but if you used something that looks like "light2.png" it would have been cooler looking as it has a nifty fade into it.

I'm guessing the thing I suggested would look very similar to the darkness effect in four sword adventures, and that darkness looks awesome.
You can still get the same effect you're talking about by using polygons and images

__________________
Quote:
Originally Posted by Loriel View Post
Seriously, you have ****-all for content and you're not exactly pulling in new developer talent, angling for prestigious titles should be your last concern.
Reply With Quote
  #28  
Old 07-05-2008, 12:42 AM
Galdor Galdor is offline
░▒▓██▓▒░
Galdor's Avatar
Join Date: Feb 2004
Posts: 2,434
Galdor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond reputeGaldor has a reputation beyond repute
Quote:
Originally Posted by Rufus View Post
You can still get the same effect you're talking about by using polygons and images

Hmm I guess that looks fancy
__________________
Links
Draenin's Villains
Draenin's Quests

My Albums
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
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:40 AM.


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