Jump to content
  • 0

Instancing Question


Arcenciel

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

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
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

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

Link to comment
Share on other sites

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.

×
×
  • Create New...