How can I parent my hero to a slice?

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:

How can I parent my hero to a slice?

Post by sheamkennedy »

I want to parent the hero to a slice so the hero's (x,y) follow the slice's (x,y) as I manipulate it.
⊕ 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
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

I think you would use "put hero (who, x, y)" to continuously place the hero at the slice position.
Last edited by SwordPlay on Sat Nov 11, 2017 5:39 am, edited 1 time in total.
"Imagination. Life is your creation."
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Sorry, you can't reparent hero or NPC slices to anything else. We're cautious with allowing slice tree manipulations that could possibly end up being painful to support back-compatibly in future. However, it's very common that people want to reparent heroes/NPCs, so I think we should try to allow it, within limits.

(But reparenting the hero wouldn't do what you want anyway unless you also did "put hero(who, 0, 0)" to give them no offset relative to their parent)

So yes, you need to use puthero instead, or alternatively, parent the other slice to the hero instead, if possible.
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 »

Thanks both, that sorted everything out for me.
⊕ 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
Post Reply