Now if only there were some way we could see the script, one of us could perhaps tell you what's wrong so you can fix it.
Edited by klop422, 11 August 2018 - 02:58 PM.
Posted 11 August 2018 - 02:57 PM
Now if only there were some way we could see the script, one of us could perhaps tell you what's wrong so you can fix it.
Edited by klop422, 11 August 2018 - 02:58 PM.
Posted 15 August 2018 - 02:22 PM
The script is in this topic.
Edited by Mlvluu, 15 August 2018 - 02:23 PM.
Posted 15 August 2018 - 05:23 PM
Your script is wrong, as TBT has pointed out and TBT's script is incomplete, so?? Try out this script:
global script Crab{
void run(){
while(true){
for(int i = 1; i <= Screen->NumNPCs(); i++){ //cycle through all enemies
npc enemy = Screen->LoadNPC(i);
if( enemy->Attributes[15] == 5 ){ //if the correct attribute is set, it's a crab
if ( enemy->Dir == DIR_LEFT || enemy->Dir == DIR_RIGHT )
enemy->Step = 150; //higher horizontal speed
else
enemy->Step = 100; //normal speed
}
}
Waitframe();
}
}
}
Keeping it a global, since you wanted a global script.
Here's a different script, using ghost.zh:
ffc script Ghost_Crab{
void run(int enemyid){
npc ghost = Ghost_InitAutoGhost(this, enemyid);
Ghost_SetFlag(GHF_KNOCKBACK);
Ghost_SetFlag(GHF_STUN);
int counter = -1;
while(true){
if ( Ghost_Dir == DIR_LEFT || Ghost_Dir == DIR_RIGHT )
counter = Ghost_ConstantWalk8(counter, 80, 4, 0, 0);
else if ( Ghost_Dir == DIR_UP || Ghost_Dir == DIR_DOWN )
counter = Ghost_ConstantWalk8(counter, 30, 4, 0, 0);
else
Ghost_Dir = Choose(DIR_UP, DIR_DOWN, DIR_LEFT, DIR_RIGHT);
Ghost_Waitframe(this, ghost, true, true);
}
}
}
This one isn't bound to the grid. Work's better imo. ^^
Edited by Avataro, 15 August 2018 - 05:25 PM.
Posted 15 August 2018 - 06:11 PM
The grid?
Posted 15 August 2018 - 06:54 PM
Posted 15 August 2018 - 07:42 PM
So... how is that better?
Edited by Mlvluu, 15 August 2018 - 07:43 PM.
Posted 15 August 2018 - 07:58 PM
Nevermind xD Try for yourself.
Edited by Avataro, 15 August 2018 - 08:01 PM.
ZQuest Classic →
ZQuest Editor Help →
Importing enemy tilesStarted by centraltree , 07 Nov 2023 |
|
|
||
ZQuest Classic →
Developers' Exchange →
Classic-Style Sprites of BotW/TotK Enemies (TotK Spoilers)Started by Riflezen , 25 May 2023 |
|
|
||
ghost
ZQuest Classic →
Scripting Discussion →
Testers Wanted for Ghost 2.9.0Started by Timelord , 07 Oct 2021 |
|
|
||
NPC
ZQuest Classic →
Scripting Discussion →
Script Requests →
4-Way Boo (Mario Ghost) NPC-ScriptStarted by Bagu , 25 Aug 2020 |
|
|
||
header
ZQuest Classic →
Scripting Discussion →
Music.zhStarted by Timelord , 03 Jul 2017 |
|
|
0 members, 1 guests, 0 anonymous users