Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-11-2007, 11:32 PM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
making roof semi-transparent

I'm having some trouble getting my scripts to work properly online. It works good offline on the editor.

Basically when you enter a house, the roof turns semi-transparent and then when you exit the house through the door, the roof turns back to normal.

Here's my code for the roof NPC:

NPC Code:

//#CLIENTSIDE
//function onCreated() {
if (created) {
setimg roof.gif;
dontblock;
drawoverplayer;
vRoofV();
vUnderRoof = false;
}

//function onPlayerTouchsMe() {
if (playertouchsme) {
vUnderRoof = true;
}

if (vUnderRoof == true) {
vRoofI();
}
if (vUnderRoof == false) {
vRoofV();
}

// Makes roof transparent
function vRoofI() {
setcoloreffect 1,1,1,0.22;
drawaslight;
}

// Puts roof back to normal
function vRoofV() {
setcoloreffect 1,1,1,1;
//drawaslight;
}

timeout = 0.05;



When someone walks out through the door, the "vUnderRoof" flag is set back to false by touching a grass NPC as they walk out through the door:

NPC Code:

if (created) {
setimg vivendi_h10grass.png;
drawunderplayer;
dontblock;
//vUnderRoof = false;
}

if (playertouchsme) {
vUnderRoof = false;
}

timeout = 0.05;

Reply With Quote
 


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:23 PM.


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