Jump to content

Photo

Boss not Moving.


  • Please log in to reply
5 replies to this topic

#1 Joelmacool

Joelmacool

    Addicted to Overwatch

  • Moderators
  • Real Name:Joel
  • Location:Country of Europe

Posted 09 April 2017 - 03:52 PM

So, I've managed to put my script into ZC. Everything works out fine, but when I play the actual game, the enemy doesn't move and attack (Though, it still hurts you if you touch it and you can attack it).

The attributes of the enemy are:
http://prntscr.com/euflds

http://prntscr.com/eufq4j

http://prntscr.com/eufqdd

http://prntscr.com/eufm79

Spoiler


Help would be appreciated!


Edited by Joelmacool, 09 April 2017 - 03:58 PM.


#2 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 09 April 2017 - 04:35 PM

First off, please put your code in code tags. It was impossible to read before I added indents to it. You can put the code tags in spoiler tags, but if it's not in code tags, the formatting will be VERY screwed up in the post. Like so:
 
//Stalfos Boss Script
//Enemy Attributes
//A1: The number of frames (60ths of a second) the boss waits in between attacks
//A11: The first of 8 combos (Up, down, left, right, upleft, upright, downleft, downright)
//A12: The slot this script is in

//Enemy Constants (edit these)
const int SPR_STALFOSBOSSSWORD = 28980; //The sprite to use for the spinning sword. Use the first of 8 sword tiles (Up, down, left, right, upleft, upright, downleft, downright)
const int TIL_STALFOSDOWNTHRUST = 28981; //A downward facing sword tile
const int CS_STALFOSDOWNTHRUST = 2; //The cset to use for the down thrust
const int SFX_STALFOSBOSSSTAB = 3; //The sound to play when the boss does a down stab
const int SFX_STALFOSBOSSSPIN = 4; //The sound that loops every 40 frames when the boss uses the spin attack

ffc script StalfosMaCool{
	void run(int enemyid){
		npc ghost = Ghost_InitAutoGhost(this, enemyid);
		Ghost_SetFlag(GHF_8WAY);
		int AttackPause = ghost->Attributes[0];
		int Combo = ghost->Attributes[10];
		Ghost_Transform(this, ghost, Combo, ghost->CSet, 1, 1);
		int Counter;
		int AttackCounter = 0;
		while(true){
			Counter = Ghost_ConstantWalk8(Counter, ghost->Step, ghost->Rate, ghost->Homing, ghost->Hunger);
			AttackCounter++;
			if(AttackCounter>AttackPause){
				int Attack = Rand(0, 1);
				if(Attack==0){
					Ghost_Jump = 4;
					while(Ghost_Jump>0){
						Ghost_MoveTowardLink(ghost->Step/100, 0);
						Ghost_Waitframe(this, ghost, true, true);
					}
					Game->PlaySound(SFX_STALFOSBOSSSTAB);
					while(Ghost_Z>0){
						Ghost_Dir = DIR_DOWN;
						if(Ghost_Z>0)Screen->FastTile(3, Ghost_X, Ghost_Y+12-Ghost_Z, TIL_STALFOSDOWNTHRUST, CS_STALFOSDOWNTHRUST, 128);
						Ghost_Waitframe(this, ghost, true, true);
					}
					eweapon e = FireEWeapon(EW_SCRIPT10, Ghost_X, Ghost_Y+12, 0, 0, ghost->Damage, SPR_STALFOSBOSSSWORD, 0, EWF_UNBLOCKABLE);
					e->Tile++;
					SetEWeaponLifespan(e, EWL_TIMER, 1);
					SetEWeaponDeathEffect(e, EWD_VANISH, 0);
				}
				else if(Attack==1){
					int Angle = Angle(Ghost_X, Ghost_Y, Link->X, Link->Y);
					for(int i=0; i<240; i++){
						if(i%40==0)Game->PlaySound(SFX_STALFOSBOSSSPIN);
						Ghost_MoveTowardLink(1, 0);
						Ghost_Dir = AngleDir8(Angle(Ghost_X, Ghost_Y, Link->X, Link->Y));
						eweapon e = FireEWeapon(EW_SCRIPT10, Ghost_X+VectorX(16, Angle+i* 8), Ghost_Y+VectorY(16, Angle+i* 8), 0, 0, ghost->WeaponDamage, SPR_STALFOSBOSSSWORD, 0, EWF_UNBLOCKABLE);
						e->Tile += AngleDir8(WrapDegrees(Angle+i* 8));
						SetEWeaponLifespan(e, EWL_TIMER, 1);
						SetEWeaponDeathEffect(e, EWD_VANISH, 0);
						Ghost_Waitframe(this, ghost, true, true);
					}
				}
				AttackCounter = 0;
			}
			Ghost_Waitframe(this, ghost, true, true);
		}
	}
}
With that said... I don't see anything wrong with it. I imported it into a test file and it worked fine, as far as actually doing stuff. Gameplay wise, his spin attack is far more threatening than his down stab, but that's not the issue we're debugging here. I'm confused by the fact that it worked fine on my end but not yours. A couple of questions. One: are you certain that the script is still in your script buffer? When you import a new script file, it overrides whatever was there previously. So your script file should either look something like this:
 
import "std.zh"
import "string.zh"
import "ghost.zh"

//Stalfos Boss Script
//Script goes here, you get the point
Or it should look like this:
 
import "std.zh"
import "string.zh"
import "ghost.zh"

import "JoelStalfos.z"
Either way, you have to be sure the buffer includes all your scripts. That's about the only thing I can think of that might be causing the issue.
  • Joelmacool likes this

#3 Joelmacool

Joelmacool

    Addicted to Overwatch

  • Moderators
  • Real Name:Joel
  • Location:Country of Europe

Posted 10 April 2017 - 04:43 AM

First off, please put your code in code tags. It was impossible to read before I added indents to it. You can put the code tags in spoiler tags, but if it's not in code tags, the formatting will be VERY screwed up in the post. Like so:
 

//Stalfos Boss Script
//Enemy Attributes
//A1: The number of frames (60ths of a second) the boss waits in between attacks
//A11: The first of 8 combos (Up, down, left, right, upleft, upright, downleft, downright)
//A12: The slot this script is in

//Enemy Constants (edit these)
const int SPR_STALFOSBOSSSWORD = 28980; //The sprite to use for the spinning sword. Use the first of 8 sword tiles (Up, down, left, right, upleft, upright, downleft, downright)
const int TIL_STALFOSDOWNTHRUST = 28981; //A downward facing sword tile
const int CS_STALFOSDOWNTHRUST = 2; //The cset to use for the down thrust
const int SFX_STALFOSBOSSSTAB = 3; //The sound to play when the boss does a down stab
const int SFX_STALFOSBOSSSPIN = 4; //The sound that loops every 40 frames when the boss uses the spin attack

ffc script StalfosMaCool{
	void run(int enemyid){
		npc ghost = Ghost_InitAutoGhost(this, enemyid);
		Ghost_SetFlag(GHF_8WAY);
		int AttackPause = ghost->Attributes[0];
		int Combo = ghost->Attributes[10];
		Ghost_Transform(this, ghost, Combo, ghost->CSet, 1, 1);
		int Counter;
		int AttackCounter = 0;
		while(true){
			Counter = Ghost_ConstantWalk8(Counter, ghost->Step, ghost->Rate, ghost->Homing, ghost->Hunger);
			AttackCounter++;
			if(AttackCounter>AttackPause){
				int Attack = Rand(0, 1);
				if(Attack==0){
					Ghost_Jump = 4;
					while(Ghost_Jump>0){
						Ghost_MoveTowardLink(ghost->Step/100, 0);
						Ghost_Waitframe(this, ghost, true, true);
					}
					Game->PlaySound(SFX_STALFOSBOSSSTAB);
					while(Ghost_Z>0){
						Ghost_Dir = DIR_DOWN;
						if(Ghost_Z>0)Screen->FastTile(3, Ghost_X, Ghost_Y+12-Ghost_Z, TIL_STALFOSDOWNTHRUST, CS_STALFOSDOWNTHRUST, 128);
						Ghost_Waitframe(this, ghost, true, true);
					}
					eweapon e = FireEWeapon(EW_SCRIPT10, Ghost_X, Ghost_Y+12, 0, 0, ghost->Damage, SPR_STALFOSBOSSSWORD, 0, EWF_UNBLOCKABLE);
					e->Tile++;
					SetEWeaponLifespan(e, EWL_TIMER, 1);
					SetEWeaponDeathEffect(e, EWD_VANISH, 0);
				}
				else if(Attack==1){
					int Angle = Angle(Ghost_X, Ghost_Y, Link->X, Link->Y);
					for(int i=0; i<240; i++){
						if(i%40==0)Game->PlaySound(SFX_STALFOSBOSSSPIN);
						Ghost_MoveTowardLink(1, 0);
						Ghost_Dir = AngleDir8(Angle(Ghost_X, Ghost_Y, Link->X, Link->Y));
						eweapon e = FireEWeapon(EW_SCRIPT10, Ghost_X+VectorX(16, Angle+i* 8), Ghost_Y+VectorY(16, Angle+i* 8), 0, 0, ghost->WeaponDamage, SPR_STALFOSBOSSSWORD, 0, EWF_UNBLOCKABLE);
						e->Tile += AngleDir8(WrapDegrees(Angle+i* 8));
						SetEWeaponLifespan(e, EWL_TIMER, 1);
						SetEWeaponDeathEffect(e, EWD_VANISH, 0);
						Ghost_Waitframe(this, ghost, true, true);
					}
				}
				AttackCounter = 0;
			}
			Ghost_Waitframe(this, ghost, true, true);
		}
	}
}
With that said... I don't see anything wrong with it. I imported it into a test file and it worked fine, as far as actually doing stuff. Gameplay wise, his spin attack is far more threatening than his down stab, but that's not the issue we're debugging here. I'm confused by the fact that it worked fine on my end but not yours. A couple of questions. One: are you certain that the script is still in your script buffer? When you import a new script file, it overrides whatever was there previously. So your script file should either look something like this:
 
import "std.zh"
import "string.zh"
import "ghost.zh"

//Stalfos Boss Script
//Script goes here, you get the point
Or it should look like this:
 
import "std.zh"
import "string.zh"
import "ghost.zh"

import "JoelStalfos.z"
Either way, you have to be sure the buffer includes all your scripts. That's about the only thing I can think of that might be causing the issue.

 

Thanks for telling me about the code tags, but with the script, I set it up like so:

http://prntscr.com/eum7yh

I'm pretty sure this is fine, but the script doesn't seem to want to work.


EDIT: Oh, oh! I got it to work! I've remembered that when working with ghost, you need to replay the quest to actually get the script to function. So, I've made a new quest file and played from scratch (Using cheats to speed things a bit) and I got to the boss room, that's where I found out that the script worked all along!

What a silly mistake, lol.


Edited by Joelmacool, 10 April 2017 - 04:43 AM.


#4 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 10 April 2017 - 04:54 AM

Oh. Yeah, that'd do it. Any time you add new global variables (or global constants), which ghost.zh does, you've got to start from a new save file. You're hardly the first person to make that mistake. I've done it myself before. A lot. >_>
  • Joelmacool likes this

#5 Joelmacool

Joelmacool

    Addicted to Overwatch

  • Moderators
  • Real Name:Joel
  • Location:Country of Europe

Posted 10 April 2017 - 05:22 AM

New small issue... When the boss does it's spin attack, the sprites used are:
http://prntscr.com/eumqun(The default sword tiles)
and not the sprites I made.
In the script, I made the "const int SPR_STALFOSBOSSSWORD = 28960". But, it still uses the default tiles. Does anyone know why it's doing this?

It makes the spin attack look really bad... as seen here:
http://prntscr.com/eums82
and here:

http://prntscr.com/eumsao


Edited by Joelmacool, 10 April 2017 - 05:23 AM.


#6 Joelmacool

Joelmacool

    Addicted to Overwatch

  • Moderators
  • Real Name:Joel
  • Location:Country of Europe

Posted 10 April 2017 - 06:21 AM

Nevermind, I fixed it! :D




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users