Arcenciel Posted December 15, 2011 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
Ind Posted December 15, 2011 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
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 Arcenciel2 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.