Jump to content
  • 0

Instancing Question


Question

Posted (edited)

I'm trying to learn how to create instances so I decided to look at npc/instances/OrcMemory.txt for a model. I'm stumped however by this section.

for( set .@i, 1; .@i <= 2; set .@i, .@i + 1 ) {
if( instance_attachmap(.@i + "@orcs", .@instance) == "" )
break;
}
if( .@i < 2 ) {
instance_destroy(.@instance);
close;
}

Is 2 used because 1@orcs and 2@orcs are the original maps and that shouldn't be used for the instance or is it because of other reasons?

Edited by Arcenciel

2 answers to this question

Recommended Posts

Posted

it breaks out of the loop when instance fails to attach, in that case .@i will be lower than 2 (because you are trying to attach 2 instances), and it deletes the whole instance set with instance_destroy

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...