Set NPC picture?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Set NPC picture?

Post by sheamkennedy »

Is there a way to set the NPC picture similar to the way the "set hero picture" command works? I feel like this should have been in the dictionary but it's not. Is there a way I could mimic this command in such a way that does not destroy the NPC that I want to change the sprite picture of?

I ask because I'm controlling an NPC for the purpose of a 2nd player. I have a whole bunch of other scripts which rely on that NPC remaining as NPC ID#22 no matter whether the NPCs sprite is to be changed.

EDIT: I see I might be able to use "change NPC ID (reference,new ID)" but my main concern is that I have a hitbox bound to NPC ID#22. If I want this hitbox on the new ID NPC would I need to initialize the hitbox again and again? For instance every time my NPC character jumps or climbs a ladder or swims she still requires her hitbox, so will I have to continually bind the hitbox to her every time her sprite changes?
Last edited by sheamkennedy on Fri Mar 25, 2016 6:51 am, edited 1 time in total.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
User avatar
FnrrfYgmSchnish
Metal Slime
Posts: 741
Joined: Thu Jun 18, 2009 4:37 am
Location: Middle of Nowhere

Post by FnrrfYgmSchnish »

"Alter NPC" is the command for changing NPC pictures (and a whole lot of other things), if I'm remembering right. I'm guessing that's why there's no "Set NPC Picture" -- Alter NPC already does that and also walk speed, walk type, and so on.
FYS:AHS -- Working on Yagziknian NPC walkabout sprites
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

FnrrfYgmSchnish wrote:"Alter NPC" is the command for changing NPC pictures (and a whole lot of other things), if I'm remembering right. I'm guessing that's why there's no "Set NPC Picture" -- Alter NPC already does that and also walk speed, walk type, and so on.
Oh thanks, I must have overlooked that completely. That should be what I need. I'll try it tomorrow when I wake up. Thanks for the quick response.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
User avatar
kylekrack
Liquid Metal Slime
Posts: 1242
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Code: Select all

set sprite set number (lookup slice(sl:walkabout sprite component, get npc slice(NPC reference(22))), record)
Something where you lookup the NPC's walkabout sprite and then change it using 'set sprite set number' might work? I wouldn't copy and paste that directly, it might be pretty buggy; the special slice lookup might be wrong.

Might I also recommend adding a hero to the party and then disabling caterpillar mode instead of using an NPC? You may be too deep to make a change as drastic as that now, but it may prove to help with the organization of everything in the long run.
My pronouns are they/them
Ps. I love my wife
Post Reply