[FONT=Times New Roman][SIZE=3]Please Help: Battle engine[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]I all new to kF.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]You see I’m making this rpg and need some help making the battle engine part of it.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]You see I load the enemies from an external source. They are predefined in an external source[array].[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]_root.enemynumber=3;[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]_root.enemydata=[["demonking",5],["sharkman",5],["mutantfrog",5]];[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]You see I am having some trouble loading them. What I was hoping someone could help me out with is creating a new movie clip for each of the enemy in the series en1, en2, en3[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Etc according to the _root.enemynumber var.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Here’s what I have so far:[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]stop();[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]_global.enemies = _root.enemydata;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]_global.enemyno = _root.enemynumber;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]_global.enemDataArray = [[]];[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]_global.phase = 1;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]for (i=0; i<_global.enemyno; i++) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] select = i;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] enemy = _global.enemies[select][0];[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] tempAr = [select, _global.enemies[select][1]];[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _global.enemDataArray.push(tempAr);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] var im:MovieClip=this.createEmptyMovieClip(i,this.getNextHighestDepth())[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _root.im.loadMovie(enemy+".swf")[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] with (_root.im) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _root.im.onPress = function() {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _root.curmon = this._name;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] trace(_root.curmon);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _root.enemhp = _root.curmonhp;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] this.onEnterFrame = function() {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _root.enemhp = _global.enemDataArray[_root.curmon][1];[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] if (_global.enemDataArray[this._name][1]<=0) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _global.enemyno--;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] removeMovieClip(this);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] this._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] };[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] };[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _y = 100+(50*i);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _x = 400;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]}[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Any help will be very much appreciated and your name will be added to the credits Thanks,[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]bbsf[/SIZE][/FONT]
:ub: