Question about placing NPCs

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
ncw64
Slime Knight
Posts: 223
Joined: Mon Jun 21, 2010 4:11 am
Location: Edinboro, PA

Question about placing NPCs

Post by ncw64 »

Sorry for the trouble, but is there a rule that you can't place NPCs on walls or something? I'm trying to have invisible one-time use NPCs inside my drawers that contain items to give you the textbox/item on use, but they won't appear (they aren't invisible right now, obviously). I tried putting them other places and they will appear and work properly.

Any idea what's going on? Or is it just that I'm not allowed to have them in walls?

Thanks in advance!
You can't fix stupidity.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6462
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

You're totally allowed to have them in walls. Something else must be causing it.
My only real thought would be maybe your wall tiles are an overlapping layer and just causing you not to see the npcs. Have you actually tried just using them?
Or perhaps you're having them use a tag that's being used by something else already. If you want different npc's to give the same items, you still need to make a new npc each time you place it on the map, otherwise once 1 is used they will all disappear.

That's all I can think of right now, I'd really need more information to help you unfortunately.
Last edited by Spoonweaver on Tue Apr 16, 2013 6:44 pm, edited 2 times in total.
ncw64
Slime Knight
Posts: 223
Joined: Mon Jun 21, 2010 4:11 am
Location: Edinboro, PA

Post by ncw64 »

Hmm, yea- I've tried using them in case they were behind a layer, and they are set to "always" be available, just as a one-use thing.

Here is some info I can say (maybe some of it will help discern the problem?)

-I have a "new game" script that moves my hero and teleports him downstairs essentially. Then, if you go back upstairs after the script has ended, the drawers should have the item. It's pretty much just not allowing me to put them inside the wall-mapped drawer tile. I've experimented with other tiles and it seems to work. I'll have more info as I test it more.

Thanks a lot, man!

EDIT: Okay, new edit- the only places they CAN'T be are the drawers on the screen the game enters on. They can be anywhere else on that screen, and in any drawers in any other location on any map. For some reason, it is just breaking there. There isn't anything special about the tiles, either...
Last edited by ncw64 on Tue Apr 16, 2013 8:03 pm, edited 1 time in total.
You can't fix stupidity.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Do they show up in custom when you place them using the map editor?
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6462
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

Maybe it's that script you were talking about, posting it might help.

That or it's some sort of engine bug, though I don't think that to be the case.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

There is a debug key that isn't well known that may help: Ctrl+F11 shows the positions of all NPC instances, including NPCs that have been disabled due to either tag conditions or one-time-used tags (they show up with negative ID numbers). Top numbers are IDs, bottom are (negated) references.
ncw64
Slime Knight
Posts: 223
Joined: Mon Jun 21, 2010 4:11 am
Location: Edinboro, PA

Post by ncw64 »

I'm 99% sure the script doesn't mess it up, but I will post it:

plotscript, new game, begin

RevCost := 25
steps := 1

suspend player

show text box(1)
wait for text box
show text box(2)
wait for text box
show text box(3)
wait for text box

walk hero(0, east, 9)
wait for hero(0)
walk hero(0, south, 2)
wait for hero(0)
walk hero(0, east, 6)
wait for hero(0)
walk hero(0, north, 3)
wait for hero(0)

fade screen out(63, 63, 63)
wait(30)
teleport to map(2, 28, 73)
add hero(6)
walk hero(0, south, 1)
wait for hero(0)
walk hero(0, north, 1)
wait for hero(0)
fade screen in

show text box(4)
wait for key (use key)
show text box(5)
wait for key (use key)
show text box(6)
wait for key (use key)
show text box(7)
wait for key (use key)
show text box(8)
wait for key (use key)
show text box(9)
wait for key (use key)
show text box(10)
wait for text box

fade screen out(63, 63, 63)
destroy NPC(6)
set tag(4, on)
set tag(6, on)

wait(10)
fade screen in

resume player


end

Thanks again. And I will try your suggestion now, TMC!
You can't fix stupidity.
ncw64
Slime Knight
Posts: 223
Joined: Mon Jun 21, 2010 4:11 am
Location: Edinboro, PA

Post by ncw64 »

uh, nevermind. It works now- I have no idea what happened, but I didn't change anything. It works though, so all good haha!
You can't fix stupidity.
ncw64
Slime Knight
Posts: 223
Joined: Mon Jun 21, 2010 4:11 am
Location: Edinboro, PA

Post by ncw64 »

Uh-oh, new problem!

Well, more of a lack of ability to script well. So here it is: I have in place a night-day script that basically just changes the day to night and vice-versa every so many steps.

The problem, is that if it's night time, and I log out, the palette doesn't stay darker, and so when you go back into the game, it looks like it's day, when it is in fact night.

I'll think about different ways to go about fixing it, but none come to mind immediately, so I was wondering if you guys could share some secrets!

Thank you, once again haha!
You can't fix stupidity.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6462
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

Well, you could have a new game or load game script that checks that, and basically loads the other script up when you start the game.
ncw64
Slime Knight
Posts: 223
Joined: Mon Jun 21, 2010 4:11 am
Location: Edinboro, PA

Post by ncw64 »

Ooooh okay, did not know there was a load game script! That's awesome!

Thanks a bunch spoon! Sorry for the noob questions and there will probably be more to come haha!
You can't fix stupidity.
Post Reply