Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-05-2006, 01:00 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
Conversion to gs2?

NPC Code:

//#CLIENTSIDE
function onCreated() {
this.state = 0;
}

function onWeaponFired() {
setTimer(.2);
}

function onTimeout() {
showimg(200,light4.png,playerx+0.7-imgwidth(light4.png)/32,playery+1-imgheight(light4.png)/32);
changeimgvis(200,3);
changeimgcolors(200,1,.5,0,.9999);
drawoverplayer();
this.state=(this.state+1)%3;
changeimgzoom(200,1+.02*this.state);
setTimer(.2);
}



Doesnt work. At all, and I have NO idea why. It's meant to display a light effect over the player, but it's being a butch and not working. Could someone please explain to me why, so i dont give myself an aneurysm from the thinking.
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #2  
Old 04-05-2006, 02:20 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Raeiphon
PHP Code:
showimg(200,light4.png,playerx+0.7-imgwidth(light4.png)/32,playery+1-imgheight(light4.png)/32); 
light4.png needs to be in quotes. and I think you should use the new 'imgwidth' and height functions, I think they're something like getimgwidth("filename")

Quote:
Originally Posted by Raeiphon
PHP Code:
drawoverplayer(); 
The changeimgvis call will make it draw over the player, this function is not needed/doesn't work in WNPCs.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 04-05-2006, 06:34 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
Okay, it works, but not as intended.

It isnt being drawn as light, and I want it drawn underneath the player. I've added drawaslight(); but that doesnt seem to work, and I cant figure out a way to toggle it when i call WeaponFired().

I appreciate the help!
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #4  
Old 04-05-2006, 06:50 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
drawaslight() only affects the NPC's actual image, which in the case of a weapon NPC, is not at all useful.

You can modify where the image is displayed by changing it's layer, i.e. changeimgvis(index, 0); will draw underneath the player, 1 and 2 will draw above the player, 3 above the darkness (seteffect()) layer, 4 upwards on the GUI layer.

Problem is, is that drawing underneath the player will mean that the light effect is mostly shut out by any daynight-style system.
__________________
Skyld
Reply With Quote
  #5  
Old 04-06-2006, 02:27 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
For drawing as a light you'd probably want to use changeimgmode() or something along those lines.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
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 01:15 PM.


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