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 09-21-2011, 01:22 AM
Ohk4y Ohk4y is offline
Registered User
Ohk4y's Avatar
Join Date: Jun 2011
Posts: 43
Ohk4y is an unknown quantity at this point
Send a message via AIM to Ohk4y
Light Effect Help

Hello, I'm trying to simulate being in a cave on my server and I was thinking I could show a polygon that covered the whole screen except for a little circle around your player.

Here's my current script to show a black screen:
PHP Code:
    showpoly(210, {
        
00screenwidth0screenwidthscreenheight0screenheight
    
});
    
changeimgcolors(2100001); 
How could I modify this to show only the area around your player? Like maybe 1 - 2 tiles around your player.
__________________
Reply With Quote
  #2  
Old 09-21-2011, 09:40 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
I think a light effect would look nicer.
*Just my personal opinion*
however if you do decide to go with a light effect iv scripted this, its as close to realistic as i can get it.
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
onTimeout();
}

function 
onTimeout() {
  
with(findimg(200)) {
    
attachtoowner true;
    
attachoffset = {
      -
2.55, -2.60
    
};
    
image "light4.png";
    
layer 0;
    
mode 0;
    
zoom 1.5;
    
red 1;
    
green 0.5;
    
blue 0.2;
    
alpha 0.99;
  }
  
settimer(0.05);

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #3  
Old 09-21-2011, 10:26 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is a jewel in the roughTricxta is a jewel in the rough
Quote:
Originally Posted by Ohk4y View Post
Hello, I'm trying to simulate being in a cave on my server and I was thinking I could show a polygon that covered the whole screen except for a little circle around your player.

Here's my current script to show a black screen:
PHP Code:
    showpoly(210, {
        
00screenwidth0screenwidthscreenheight0screenheight
    
});
    
changeimgcolors(2100001); 
How could I modify this to show only the area around your player? Like maybe 1 - 2 tiles around your player.
you have some problems here o_0 your drawing on the tile layer yet using pixel co-ordinates, if you want to draw around the player you would construct it of 4 polygons and draw it on the tile layer instead of the gui layer because the focus of the player changes. You can also calculate the outer co-ordinates of a circle using:
PHP Code:
x=cos(angle)*radius;
y=sin(angle)*radius
I could give you the script to solve your problem but where's the fun in that
I hope this helps you.
Reply With Quote
  #4  
Old 09-21-2011, 06:29 PM
iBeatz iBeatz is offline
Kavan
iBeatz's Avatar
Join Date: Dec 2010
Location: Northern Ireland, UK
Posts: 154
iBeatz will become famous soon enough
Send a message via Yahoo to iBeatz
Or instead of going to the trouble of making a polygon circle, you could just make an image which gets more transparent towards the middle, and then surround the image with black polygons, giving the same effect but with less difficulty.
__________________

Intelligence without ambition is like a bird without wings.

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 08:52 AM.


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