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:
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.
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;
}
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?
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.
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)
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
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.
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.