putnpc not working?

I’ve been working on something and have been having a problem with putnpc. The npc is put on the level at the correct x,y and the script is active (I put in the script some test code that responds to my saying “test”), but it does not show up as an image.

I've worked it down to the point where the code looks like this:

if (playerchats && strequals(#c,put))
{
putnpc image.png, script.txt, 32, 32;
}

where image.png and script.txt are in the same directory as the level file. If I change either “image.png” or “script.txt” it complains when I click “Test”, but when I change it back it does not, which indicates to me that it is not a problem with finding the filename.

Has anyone seen anything like this before?

Re: putnpc not working?

Well, from experince I don't reccomend using putnpc, as there are temper mental glitches, such as using destroy with it. But you most likely need to take the spaces out of there.

if (playerchats&&strequals(#c,put))
{
putnpc image.png,script.txt,32,32;
} 

Re: putnpc not working?

uh o.O.

you shouldn't put spaces between commands (putnpc a,b,c,d instead of putnpc a, b, c, d)

but it probably would work anyway.

Re: putnpc not working?

close, but you're all off. I figured it out… weird thing too. When I tried using putnpc with gifs, it worked just fine. For some reason or other putnpc doesn't seem to work with gifs I guess. Is this a bug?

Re: putnpc not working?

wait reread that and repost it. you used gifs in both scenes.

Re: putnpc not working?

I found that about 70% of the time when I am regularly using putnpc, (which is alot) the destroy command only executes clientside.

Re: putnpc not working?

sorry joey, yeah, the second “gifs” should have been “pngs”. Putnpc doesn’t seem to work with pngs.

And snake, no worries, the room in which I use this npc only allows one person at a time anyway. It's a kind of solitaire game.

See, my fiance really loves this one type of solitaire game but cannot find it online and it is very tedious to deal it out and play by hand but loads of fun. So I thought I'd make a present to her of making a version of the game on the computer. As it turns out, the easiest way of doing it (I think) has been to just do it in graalscript with npcs that use card-images.

If I end up ever finishing it I'll post it.

Re: putnpc not working?

You may online get a collection of other cards with some players (aka them not destroying ever unless you update level)

Re: putnpc not working?

Actually, I almost never use gifs. Just PNGs. Currently, a lot of my shops use putnpc, so I can define an item once, but use it in multiple locations. There's been no issues at all with my shop items, but the staff tool (which is also stored in a txt file and not on level) doesn't destroy properly half the time. Like snake said, it only seems to destroy clientside. That is the only issue I have with putnpc (too lazy to switch to join right now, lol)

Re: putnpc not working?

Yep.

Re: putnpc not working?

yeah if you didn't know… the gserver is sensitive. fix one thing, another breaks <.<. I think theres never been a release thats been perfect that was bigger then 4-5 updates =P

Re: putnpc not working?

rev50. :stuck_out_tongue:

Re: putnpc not working?

i'd say rev 50 was good as well, but according to beholder… something broke just don't remember what.

Re: putnpc not working?

Kinda had the same problem. But should destroy; destroy an npc for all players if the destory; command is only ran by one player?

Re: putnpc not working?

Its supposed to destroy for all players, lol

Re: putnpc not working?

Its happening with Rev 50, and on as I know of right now. I havent tested the others.

Re: putnpc not working?

It seems like, atleast for when I was testing scripts doing destroy tons. I had to script tons of it as if it were clientside. I'm thinking the main time it wouldn't destroy for a person, was when they didn't have the graal window focused. When it isn't focused, sometimes it acts like the player is paused and lots of crap doesn't run. For example, you can say a message and it will stay there indefinitely.

Re: putnpc not working?

Nah thats not it man, I've dropped warpbombs and had players walking around and at the same time I destroy it, and they still see it and are affected by it, etc.