Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   seteffect aka daynight... (https://forums.graalonline.com/forums/showthread.php?t=73508)

theHAWKER 04-15-2007 11:41 PM

seteffect aka daynight...
 
Ok, i have a cave where it gets dark when you go inside (which works fine...), then when you walk out u link to the gmap. on the gmap i want it to be light again, but whatever i do it wont work >:(

This is what i have in the cave:
PHP Code:

//#CLIENTSIDE
if (created){
dontblock;
drawaslight;
setcoloreffect 1,1,0,0.50;
timeout .5;
}
if (
timeout) {
seteffect ,,,random(.30,.60);
sleep random(.2,.1);
timeout .1;


And i also have:
PHP Code:

//#CLIENTSIDE
if (playerleaves) {
seteffect 0,0,0,.0;


non of this works... so on the gmap i have this script:
PHP Code:

//#CLIENTSIDE
if (created){
seteffect ,,,0;
}
if (
playerenters){
seteffect ,,,0;


and still it wont work x.x

can somone help me out?

Gambet 04-15-2007 11:52 PM

Just make a master control system that sets lighteffects based on the levels you are in or so (a wNPC).

If you're on the map, then you'd do:

PHP Code:

if (isonmap)
{
 
//seteffect here
}
else if (
startswith(whatever_cave.gmap,#L))
{
 
//seteffect here



etc...

theHAWKER 04-16-2007 12:05 AM

Quote:

Originally Posted by Gambet (Post 1300263)
Just make a master control system that sets lighteffects based on the levels you are in or so (a wNPC).

If you're on the map, then you'd do:

PHP Code:

if (isonmap)
{
 
//seteffect here
}
else if (
startswith(whatever_cave.gmap,#L))
{
 
//seteffect here



etc...

there would be alot of "else if's"...

Inverness 04-16-2007 12:09 AM

Quote:

Originally Posted by theHAWKER (Post 1300264)
there would be alot of "else if's"...

Then make the system with a for loop. And have an array of level prefixes and seteffect parameters for the loop to use.

cbk1994 04-16-2007 03:01 AM

PHP Code:

setstring this.levelslevel1.nwlevel2.nw;
setstring this.level_level1.nw0001;
setstring this.level_level2.nw0011;
setstring this.startoverworldcavegmapelitehouse;
setstring this.start_overworld0001;
setstring this.start_cavegmap0.5.51;
setstring this.start_elitehouse1.501;
for ( 
0this.levels.size(); a++ ) // I don't know the GS1 size var for an array, sorry!
{
  if ( 
strequals#L, #s( this.levels[a] ) ) )
  
{
    
setstring this.tempthis.( @ "level_" #s( this.levels[a] ) ); // Really sorry, not sure if this is possible in GS1
    
seteffect this.temp[0], this.temp[1], this.temp[2], this.temp[3];
  }
}
for ( 
0this.start.size(); a++ ) // I don't know the GS1 size var for an array, sorry!
{
  if ( 
startswith#s( this.start[a] ), #L ) )
  
{
    
setstring this.tempthis.( @ "start_" #s( this.start[a] ) ); // Really sorry, not sure if this is possible in GS1
    
seteffect this.temp[0], this.temp[1], this.temp[2], this.temp[3];
  }


A few things might need tweaked but I think that will work ...

theHAWKER 04-17-2007 12:29 AM

ok thx to u guys i fixed it thank you :D


All times are GMT +2. The time now is 09:23 AM.

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