Arcenciel Posted December 15, 2011 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 1315 Reputation: 372 Joined: 12/10/11 Last Seen: August 31, 2013 Share Posted December 15, 2011 (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 December 15, 2011 by Arcenciel Quote Link to comment Share on other sites More sharing options...
Ind Posted December 15, 2011 Group: Members Topic Count: 169 Topics Per Day: 0.03 Content Count: 1260 Reputation: 750 Joined: 11/19/11 Last Seen: April 11, 2013 Share Posted December 15, 2011 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 Quote Link to comment Share on other sites More sharing options...
Arcenciel Posted December 15, 2011 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 1315 Reputation: 372 Joined: 12/10/11 Last Seen: August 31, 2013 Author Share Posted December 15, 2011 Oh, I get it. Thanks. Quote Link to comment Share on other sites More sharing options...
Question
Arcenciel
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.
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 ArcencielLink to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.