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 12-31-2011, 05:18 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Polygon cutout?

I know this is somewhere on the forums but I seem to not be able to find it after hours of searching. So I played with some scripts and tried to get a polygon to display around the whole screen with a cutout around the player.

This is what I came up with. Any suggestions why the top left part of my screen and part of the inner circle dont display right.. Im not 100% familiar with polygons yet.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
setTimer(0.05);
}
function 
onTimeout() { 
  
temp.circle NULL;
  
temp.circle.add(0);
  
temp.circle.add(0);
  
temp.circle.add(screenwidth);
  
temp.circle.add(0);
  
temp.circle.add(screenwidth);
  
temp.circle.add(screenheight);
  
temp.circle.add(0);
  
temp.circle.add(screenheight);
  for ( 
temp.0temp.< ( pi); temp.+= ( pi 32);) { 
    
temp.circle.addplayer.5.5 costemp.a)); 
    
temp.circle.addplayer.5.5 sintemp.a));
  }
  
temp.circle.add(0);
  
temp.circle.add(0);
  if ( 
player.account == "bloodpet" ) {
    
showPoly1000temp.circle);
    
with(findimg(1000)) { red=green=blue=0; }
    
findimg(1000).alpha .8;
  }
  
  
setTimer(0.05); 

I am playing with making the lantern actually light up the level Also getting it completely black around player with a cutout I am trying to accomplish as well..
Attached Thumbnails
Click image for larger version

Name:	graal_1325304744.png
Views:	220
Size:	20.9 KB
ID:	54141   Click image for larger version

Name:	graal_1325301531.png
Views:	276
Size:	159.7 KB
ID:	54142  

Last edited by scriptless; 12-31-2011 at 06:15 AM..
Reply With Quote
  #2  
Old 12-31-2011, 06:02 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
It's probably easier to create a circle image with a square border then fill in the gaps with polygons.
__________________
Quote:
Reply With Quote
  #3  
Old 12-31-2011, 06:17 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Not sure what you mean.. Black image with cutout of a circle stretched over screen? Couldnt that mess the circle up??
Reply With Quote
  #4  
Old 12-31-2011, 06:22 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 need to add the first coordinates to the end as well.
Reply With Quote
  #5  
Old 12-31-2011, 06:28 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Thanks. That fixed it..

How about for making the lights also show on the poly??
Reply With Quote
  #6  
Old 12-31-2011, 06:47 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 scriptless View Post
Thanks. That fixed it..

How about for making the lights also show on the poly??
You mean multiple lightsources? You're not going to be able to do it.

Also, none of my HD LttP graphics were up for grabs, like the bush, so could you please remove them?
Reply With Quote
  #7  
Old 12-31-2011, 06:54 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
You mean multiple lightsources? You're not going to be able to do it.

Also, none of my HD LttP graphics were up for grabs, like the bush, so could you please remove them?
I know nothing of the graphics, just scripts. However, I passed your message along. And I am told they will be removed.

Well other then multiple light sources. How would I make multiple lanterns actually light up near there area.. I tried seteffect() and using a light with an alpha.. and that didn't improve visibility at all.. *shrugs*.. tried poly's too.
Reply With Quote
  #8  
Old 12-31-2011, 06:56 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 scriptless View Post
I know nothing of the graphics, just scripts. However, I passed your message along. And I am told they will be removed.

Well other then multiple light sources. How would I make multiple lanterns actually light up near there area.. I tried seteffect() and using a light with an alpha.. and that didn't improve visibility at all.. *shrugs*.. tried poly's too.
You're gonna have a hard-ass time doing it, sorry. And by hard-ass time, I mean virtually impossible without excessive CPU usage.
Reply With Quote
  #9  
Old 12-31-2011, 06:57 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
You're gonna have a hard-ass time doing it, sorry. And by hard-ass time, I mean virtually impossible without excessive CPU usage.
Figured. Is there any approach to at least making it visually pleasing? or do most cases it just looks like crap?

Would be neat to have image masking here..



Also: were sorry for using your gfx without your permission. They are being removed. It wasn't realized they were not up for grabs.
Reply With Quote
  #10  
Old 12-31-2011, 07:12 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 scriptless View Post
Figured. Is there any approach to at least making it visually pleasing? or do most cases it just looks like crap?

Would be neat to have image masking here..
Nope :/ If it was possible it would have been done by now Only way I can suggest is to use a drawingpanel gui and fill it all white and draw black holes in it according to the screen and light sources. It's sort of like making a mask. Then draw this on the screen. Only problem is it's very cpu intensive, but v6 does drawingpanels a bit better, and you can alleviate the cpu usage by rendering the drawingpanel at like half resolution and then upscaling.



Quote:
Originally Posted by scriptless View Post
Also: were sorry for using your gfx without your permission. They are being removed. It wasn't realized they were not up for grabs.
NP. Thanks for the cooperation.
Reply With Quote
  #11  
Old 12-31-2011, 07:15 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Are there any examples of drawingpanel? I am completely unfamiliar with it.
Reply With Quote
  #12  
Old 12-31-2011, 07: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
Quote:
Originally Posted by scriptless View Post
Are there any examples of drawingpanel? I am completely unfamiliar with it.
http://wiki.graal.net/index.php/Crea...uiDrawingPanel

However in v6 you can do things like draw polygons and apply filters. If you check out my old server upload I posted in the playerworld section you might find the script in there I made using this technique:


As you can see there are cons. It's a gui, so it's going to be drawn over all in-game elements like showimgs, and it might try to steal focus since it's being drawn over the entire screen. Also, since you're coordinating level positions like players to gui positions, it tends to be a frame behind the player, which can look sort of bad.
Reply With Quote
  #13  
Old 12-31-2011, 07:25 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
http://wiki.graal.net/index.php/Crea...uiDrawingPanel

However in v6 you can do things like draw polygons and apply filters.
I am using V6.. And I will more then likely be developing for V6 and dissabling features that cause problems in v5 or providing a v5 version.

Sadly, the wiki lacks hardcore information. Like you said about drawing poly's not even mentioned in the wiki for guidrawingpanel..
Reply With Quote
  #14  
Old 12-31-2011, 07:31 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
http://wiki.graal.net/index.php/Crea...uiDrawingPanel

However in v6 you can do things like draw polygons and apply filters. If you check out my old server upload I posted in the playerworld section you might find the script in there I made using this technique:


As you can see there are cons. It's a gui, so it's going to be drawn over all in-game elements like showimgs, and it might try to steal focus since it's being drawn over the entire screen. Also, since you're coordinating level positions like players to gui positions, it tends to be a frame behind the player, which can look sort of bad.
I saw that and was wondering where the script was because I was quite curious how you did it. It's kinda what i want to do but the light wouldnt completely cut out from the poly.. i would need to draw circles over those holes and apply a lesser darkness..

or.. apply lessed darkness where not cur out.. and then throw a slight darkness under it..
Reply With Quote
  #15  
Old 12-31-2011, 07:33 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 scriptless View Post
I saw that and was wondering where the script was because I was quite curious how you did it. It's kinda what i want to do but the light wouldnt completely cut out from the poly.. i would need to draw circles over those holes and apply a lesser darkness..

or.. apply lessed darkness where not cur out.. and then throw a slight darkness under it..
The effect is made via drawing an image of a white circle over the black-filled drawingpanel. You can use softer images(excuse the low quality, I was trying a very low resolution):
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 09:07 AM.


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