Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   Alright! (https://forums.graalonline.com/forums/showthread.php?t=27020)

Saga2001 04-06-2002 07:01 AM

Alright!
 
I have been working on this hat trading npc ever since Bhala decided to mess with it...and now...setgif isn't working...
So I post this qustion here to those of you who are leeter than I. Also its not that setgif needs to be cs because if i setgif door.png; it works fine, i think its not evaluating correctly and the .png is getting chopped or something.

NPC Code:

putnpc2 aimx,aimy,{
if (created) {
setshape 1,48,48;
setgifpart hat#v(this.item).png,96,0,48,48;
}
if (playertouchsme) {
hatc = strtofloat(#s(hatc#v(this.item)))+1;
setstring client.hatc#v(this.item),#v(hatc);
savelog2 hat-log.txt, +hat: #v(this.item) at (#v(x),#v(y)) in #L from #s(this.layer);
destroy;
}
};



I know its in the setgif cause it works fine with showimg and also another thing, setimg doesn't work and those places on the image with the setgifpart are correct...everything is setting right cept the setgif...any suggestions?

Cybnext_Design 04-06-2002 11:46 AM

Re: Alright!
 
Quote:

Originally posted by Saga2001
I have been working on this hat trading npc ever since Bhala decided to mess with it...and now...setgif isn't working...
So I post this qustion here to those of you who are leeter than I. Also its not that setgif needs to be cs because if i setgif door.png; it works fine, i think its not evaluating correctly and the .png is getting chopped or something.

NPC Code:

putnpc2 aimx,aimy,{
if (created) {
setshape 1,48,48;
setgifpart hat#v(this.item).png,96,0,48,48;
}
if (playertouchsme) {
hatc = strtofloat(#s(hatc#v(this.item)))+1;
setstring client.hatc#v(this.item),#v(hatc);
savelog2 hat-log.txt, +hat: #v(this.item) at (#v(x),#v(y)) in #L from #s(this.layer);
destroy;
}
};



I know its in the setgif cause it works fine with showimg and also another thing, setimg doesn't work and those places on the image with the setgifpart are correct...everything is setting right cept the setgif...any suggestions?

Why not just use:
NPC Code:

setimg haticons.png;
setcharani hatnpc,#v(#s(this.item));


instead of setgifpart?

Python523 04-06-2002 12:07 PM

try making the setgif clientsided

Saga2001 04-07-2002 06:55 AM

Quote:

Originally posted by Python523
try making the setgif clientsided
no, because setgif door.png works serverside so why would that matter...plus I did try that, no avail. I'll try the ani thing.

Admins 04-07-2002 08:59 PM

What exactly is not working, you don't see it?
If the image (hatxxx.png) is on the server then it should work

Saga2001 04-08-2002 04:09 PM

Quote:

Originally posted by Stefan
What exactly is not working, you don't see it?
If the image (hatxxx.png) is on the server then it should work

Yes that is precicely it, you cannot see the image, and the image is on the server, I think maybe this should be in the bugs section, because the code appears correct.

mhermher 04-09-2002 11:31 PM

Quote:

Originally posted by Saga2001


Yes that is precicely it, you cannot see the image, and the image is on the server, I think maybe this should be in the bugs section, because the code appears correct.

make the image a gif or 8 bit png :)

Saga2001 04-10-2002 05:52 AM

Quote:

Originally posted by mhermher

make the image a gif or 8 bit png :)

Ummmm...
I do believe that all the hats meet those requirements...

Spanko 04-10-2002 06:13 AM

Have you checked to see if it's properly passing the this.item string?
That's relatively easily done by just checking the local info on the level the NPC was just placed on.
If that isn't it, I don't know. Though of course replacing setgifpart with setimgpart looks fancier :P

ZeroFXSM 04-10-2002 11:15 AM

I still purpose that there should be a simulation so people want to test out serverside npcs CAN test them out.

Saga2001 04-10-2002 03:02 PM

Quote:

Originally posted by Spanko
Have you checked to see if it's properly passing the this.item string?
That's relatively easily done by just checking the local info on the level the NPC was just placed on.
If that isn't it, I don't know. Though of course replacing setgifpart with setimgpart looks fancier :P

Yes I have it is passing the string, message #v(this.item); passes fine...:megaeek:

Spanko 04-10-2002 07:00 PM

Quote:

Originally posted by Saga2001


Yes I have it is passing the string, message #v(this.item); passes fine...:megaeek:

In that case it's probably doing the created before it passes it on, just do a .1 second delay before it sets the image, it might fix it.

SaijinGohan 04-12-2002 07:03 AM

I agree with the gani stuff, it seems more.. sophisticated to me it seems

Slaktmaster 04-17-2002 01:14 PM

Quote:

Originally posted by Saga2001


Yes I have it is passing the string, message #v(this.item); passes fine...:megaeek:

String?
Then it should be #s(this.item).

Admins 04-17-2002 06:38 PM

if you do

item = blabla;
putnpc x,y,blabla;
with (npcs[npcscount-1]) {
this.item = item;
}

it should work,
you can also use the local npc attributes log (there is a button on the RC) to see if this.item is set correctly

Falcor 04-17-2002 07:44 PM

Why not set the image in the with operator?

with(npcs[npcscount-1]) {
this.item = blahblahblah;
setgif hat#v(this.item).png;
}

????
I never tried it but im pretty sure it works.

Saga2001 04-18-2002 05:16 AM

Quote:

Originally posted by Stefan
if you do

item = blabla;
putnpc x,y,blabla;
with (npcs[npcscount-1]) {
this.item = item;
}

it should work,
you can also use the local npc attributes log (there is a button on the RC) to see if this.item is set correctly

No, that didn't work, but i believe i did get it working, oh yeah and it wasn't a string sorry it was a var. Also if I parsed the this.item as a var it should return 0 so it would have just always been hat0.png. And I dumped the level vars, and it didn't do what it should have, that was when Andor's NPC Server was still a bit messed up. Maybe it was fixed.


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

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