 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
G (♥) A ~~Garland ♥'s Arylon~~
Joined: 15 Jul 2010 Posts: 5
|
Posted: Thu Jul 15, 2010 1:03 pm Post subject: another wonderful slice/parent question... |
|
|
So...
used to play with ohr a bunch back in the day, but have downloaded it again for nostalgia / old time's sake
very impressed with the new stuff added
glad to see it and James are each still going strong
but I have some problem using slices with maplayers...
is this feature complete?
I wanted to load a medium enemy sprite; make it a parent to a map layer and then put the sprite ontop of an npc location...
it'll just be a boat to ferry the player across
when I test i get a script error:
setparent: invalid slice handle -101002
here's my code:
Code: |
plotscript,rowboat,begin
variable (boat)
boat:= load medium enemy sprite (1,2)
set parent (boat,sl:maplayer2)
put slice (boat, npc pixel x(20), npc pixel y(20))
end
|
am I missing something?
or is there a better way to do this?
I'm sure there are endless amounts of slice/layer questions delivered on here....
thanks _________________ For those in the know: Jerkwad. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Jul 15, 2010 1:40 pm Post subject: |
|
|
The map layer slice system is not fully complete. You cannot make a map layer a child of some other slice.
...but that doesn't really sound like what you want to do. Instead of making the boat the parent of the map, what you really want is to make the map the parent of the boat (which totally works)
Also, the sl: constants are *only* used for the "lookup slice" commands, you shouldn't use them with any other slice commands.
Here is an example.
Code: |
plotscript,rowboat,begin
variable (boat, map)
boat:= load medium enemy sprite (1,2)
map := lookup slice(sl:maplayer2)
set parent(boat, map)
put slice (boat, npc pixel x(20), npc pixel y(20))
end
|
|
|
Back to top |
|
 |
G (♥) A ~~Garland ♥'s Arylon~~
Joined: 15 Jul 2010 Posts: 5
|
Posted: Thu Jul 15, 2010 2:08 pm Post subject: |
|
|
oh yes that is what I wanted, thanks James!
this worked perfect
guess I accidentally said I wanted the boat the parent rather than vice versa _________________ For those in the know: Jerkwad. |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|