spawn model based on conditional?

Discuss the ZGameEditor Visualizer plugin for FL-Studio.

Moderator: Moderators

Post Reply
Mic
Posts: 47
Joined: Mon May 30, 2011 8:10 pm

spawn model based on conditional?

Post by Mic »

In the structure

RepeatSpawnX: Repeat "Iterate X"
OnIteration
ZExpression
SpawnModel TestMod1


how do you do

if(x < 15)
{
SpawnModel TestMod1
} else{
SpawnModel TestMod2
}

Can it be done within the Project tree or is it an edit xml thing? Hints would be fine :-) TIA,

Mic.
Mic
Posts: 47
Joined: Mon May 30, 2011 8:10 pm

Post by Mic »

Excellent. Got it.
Mic
Posts: 47
Joined: Mon May 30, 2011 8:10 pm

Post by Mic »

k :) did this with a Condition "Is Iteration < 15?" and an OnTrue SpawnModel 1 with an OnFalse SpawnModel 2. Now I want to add a 3rd Model.

Do I have to

Condition "Is Iteration < 10?"
OnTrue
SpawnModel1
OnFalse
OnCondition "Is Iteration < 20?"
SpawnModel2
OnFalse
SpawnModel3

or can I get to these Components with code in a ZExpression as in

if( Iteration < 10 ) {
spawnModel(Model1)
} else if( Iteration < 20 ) {
spawnModel(Model2)}
else if( Iteration <= 30 ) {
spawnModel(Model3)}

Thanks,

Mic
User avatar
VilleK
Site Admin
Posts: 2319
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

You can use the createModel-function that was introduced in 2.0.

It is only documented here at the moment because the documentation wiki is slightly outdated.
Mic
Posts: 47
Joined: Mon May 30, 2011 8:10 pm

good reading - thanks

Post by Mic »

Is there any info on some of the options that show up under Add Component? Stuff like CallComponent etc? As always TIA.
User avatar
VilleK
Site Admin
Posts: 2319
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

If you see a component or property that is not documented on the wiki then search for it on this forum and you'll find help. Nothing has been added that hasn't been discussed on these forums first.

For instance info about CallComponent can be found here.

I should really update the wiki but unfortunately I find writing documentation very boring. Which is a shame because if it's not documented no one will use the features of course, but still this is a hobby project I'm doing for fun so things I find boring tend to be postponed :) . For these reasons volunteers willing to help update the wiki is highly welcomed.
Mic
Posts: 47
Joined: Mon May 30, 2011 8:10 pm

Post by Mic »

thanks - I know all the info is out there somewhere - just having a little difficulty finding it at the moment
Post Reply