Is there any way to add custom objects to a scene? (1 Viewer)

SkyHeart

Casual Client
Joined
Apr 17, 2017
So this might seem like a dumb question (And most probably, it is) but, Is there any way to add custom made objects to a scene?

I'm talking like the way Animtools does with the preset list of objects it has (Couch, chair, bed ect.).
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
yes, by adding assets to the layers

animtools does this my placing all of its props on a single movieclip 'propholder' which is then placed right above the game's background layer

for(var p = 0; p < allprops.length; p++)
{
propholder.addChildAt(this[allprops[p]],0);
}
g.bg.parent.addChildAt(propholder, g.bg.parent.getChildIndex(g.bg) + 1);
g.sceneLayer.giveExternalLayer(propholder);


'g' is one of the main game objects defined in sdt, see some of my mod source codes for the basic code setup on how to get to it. also my thread has a copy of the game's actionscript if you wanted to see all the stuff under the hood.
 

SkyHeart

Casual Client
Joined
Apr 17, 2017
yes, by adding assets to the layers

animtools does this my placing all of its props on a single movieclip 'propholder' which is then placed right above the game's background layer

for(var p = 0; p < allprops.length; p++)
{
propholder.addChildAt(this[allprops[p]],0);
}
g.bg.parent.addChildAt(propholder, g.bg.parent.getChildIndex(g.bg) + 1);
g.sceneLayer.giveExternalLayer(propholder);


'g' is one of the main game objects defined in sdt, see some of my mod source codes for the basic code setup on how to get to it. also my thread has a copy of the game's actionscript if you wanted to see all the stuff under the hood.

I've never really done/worked with any code besides some very basic C++ stuff. I understand how the "for" funcion works, and I guess I'm going to understand more of what each line does once I'll read your mod source codes and the game's actionscript.

All that being said, I'm going to make a guess.
The line inside the function repeats itself until all the designated props are listed in the menu?
Then "g" is the main game object, "bg" is probably short for background, "parent" refers to the actual big background? To that you add a child (Which I have no Idea what it is) at the location? of propholer's value and... "g.bg.parent.getChildIndex(g.bg) + 1" no idea what that menas.
And the last line creates an extra layer over the background and add the value of "propholder" (Which is probably the prop I've chosen) to it

I don't know. That's just me doing deductive logic
Thanks for pointing me in the right direction. I'll certainely read all the material as soon as I can
 

Users who are viewing this thread

Top


Are you 18 or older?

This website requires you to be 18 years of age or older. Please verify your age to view the content, or click Exit to leave.