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 07-13-2002, 04:07 AM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
Lantern

Here what I have, door.png for a test...

NPC Code:

if (playertouchsme) {
toweapons Lamp;
}
if (weaponfired) {
if (!client.on) {
set client.on;
replaceani idle,lamp_idle;
replaceani walk,lamp_walk;
timeout=.05;
}
}

else
{
unset client.on;
replaceani idle,idle;
replaceani walk,walk;
hideimg 023;
}
if (timeout) {
if (client.on) {
showimg 023,door.png,playerx,playery;
timeout=.05;
}
}




Whats wrong, it dont show up!?
__________________
--Spark911
Reply With Quote
  #2  
Old 07-13-2002, 04:44 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
for one, to shorten the script for the on/off part, use something like
this.on=abs(this.on-1);
if(this.on==1){
//stuff
}
also, you sure the showimg part is right? try setting a drawing height
and
right now the else statement is unsetting the flag if something other than weaponfired happened
Reply With Quote
  #3  
Old 07-13-2002, 01:51 PM
user13-xo user13-xo is offline
Registered User
Join Date: Nov 2001
Location: California
Posts: 297
user13-xo is on a distinguished road
Send a message via AIM to user13-xo
Re: Lantern

Quote:
Originally posted by Spark910
Here what I have, door.png for a test...

NPC Code:

if (playertouchsme) {
toweapons Lamp;
}
if (weaponfired) {
if (!client.on) {
set client.on;
replaceani idle,lamp_idle;
replaceani walk,lamp_walk;
timeout=.05;
}
}

else
{
unset client.on;
replaceani idle,idle;
replaceani walk,walk;
hideimg 023;
}
if (timeout) {
if (client.on) {
showimg 023,door.png,playerx,playery;
timeout=.05;
}
}




Whats wrong, it dont show up!?
try 23 instead of 023?
Reply With Quote
  #4  
Old 07-14-2002, 02:54 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
whas the "client." part do? is it like "server." effects flags and strings?
__________________
Reply With Quote
  #5  
Old 07-14-2002, 06:44 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by MrGannondorf
whas the "client." part do? is it like "server." effects flags and strings?
"client." is like a "local." flag.

Stored in the user's account, able to be changed by the client, and read by the server.

I think..
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #6  
Old 07-14-2002, 03:28 PM
Shiftk03- Shiftk03- is offline
I am the trap
Shiftk03-'s Avatar
Join Date: Nov 2001
Location: Dirty South
Posts: 1,688
Shiftk03- will become famous soon enough
Quote:
Originally posted by Kaimetsu


Difference is that local.stuff isn't sent to the server.
Thats why they shouldn't be confused with each other.
__________________
Reply With Quote
  #7  
Old 07-14-2002, 04:06 PM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
Quote:
Originally posted by Kaimetsu
Grim Squeaker:

The "weaponfired" flag can never return false, though Graal might read your timeouts as a false weaponfired, thus unsetting the client.on flag.
Just move the else part to be after the if (!client.on) instead.

You don't need to set a drawing height for showimg, if you don't set one it automattically get's set to a drawing height of 2.
He was the one that helped the most, Thankyou! And thanks to the rest of you for trying to help.. Ill get full code done with working lights in 20mins and give it out for you all...
__________________
--Spark911
Reply With Quote
  #8  
Old 07-14-2002, 04:33 PM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
Damn still stuck, the index of light 2, i cant get it to set lighteffect of 023 index,

NPC Code:

if (playertouchsme) {
toweapons bob;
}
if (weaponfired) {
if (!client.on) {
set client.on;
replaceani idle,lamp_idle;
replaceani walk,lamp_walk;
timeout=.05;
}
else
{
unset client.on;
replaceani idle,idle;
replaceani walk,walk;
hideimg 023;
}
}
if (timeout) {
if (client.on) {
showimg 023,light2.png,playerx-1,playery-1.5;
changecoloreffects 023,1,0,0,0; //Unknown Command?
drawaslight;
dontblock;
timeout=.05;
}
}



Also t does not reconise this command, what other ways can you do it:

NPC Code:

changecoloreffects 023,1,0,0,0; //Unknown Command?

__________________
--Spark911
Reply With Quote
  #9  
Old 07-16-2002, 06:48 PM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
Quote:
Originally posted by Kaimetsu
Grim Squeaker:

The actual command is changeimgcolors.
Why thankyou! =D

Nearl;y done now, just getting perfect coloring....
__________________
--Spark911
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 12:51 PM.


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