ok i dont know if this one has been created yet, but i need a script where an enemy will mimic your moves and only fire a weapon if it is pointing directly at the player. im using build 584. Thanks
ok i dont know if this one has been created yet, but i need a script where an enemy will mimic your moves and only fire a weapon if it is pointing directly at the player. im using build 584. Thanks
... i just died a little inside...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"
--Andross Maximillion Remedy
(otherwise known as Rem)
Alright, I wrote this in like 10 minutes so its untested, also the weapon fireing is not implimented yet. If you would like to test it and see if this is the kind of movement you had in mind (and if it works!) Let me know, I'll write the fireing script for you as well, but not tonight, gotta work tommarow. The script as it is should create an enemy of your choice (put enemy ID in argument 0) and have it mirror Link's movement (just like those enemies in Lttp, that is what I assumed you wanted to model this after) Well let me know what you think.Code:ffc script follower{ void run(int id){ int LinkX; int LinkY; npc ene = Screen->CreateNPC(id); while(ene->isValid()) { ene->X = this->X; ene->Y = this->Y; LinkX = Link->X; LinkY = Link->Y; Waitframe(); if (Link->X > LinkX) {ene->Dir = 2; if (is_walkable(this->X-4,this->Y)){this->X -= 4;} } if (Link->X < LinkX) {ene->Dir = 3; if (is_walkable(this->X+4,this->Y)){this->X += 4;} } if (Link->Y > LinkY) {ene->Dir = 0; if (is_walkable(this->X,this->Y-4)){this->Y -= 4;} } if (Link->Y > LinkY) {ene->Dir = 1; if (is_walkable(this->X-4,this->Y)){this->Y += 4;} } } } } bool is_walkable(int x, int y) { if(x<0 || x>240 || y<0 || y>160) { return false; } return Screen->ComboS[y+(x>>4)]==0; }
ok so everywhere there is a 0 i put the enemy ID? also it wont let me copy and paste... how do i make it work?
... i just died a little inside...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"
--Andross Maximillion Remedy
(otherwise known as Rem)
Okay, to get the script into ZQ:
If you already are useing some scripts:
In ZQ, tools->Scripts - Compile ZScript - Export.
Then open the file you exported (in notepad) and add the script to it. save it
Tools->Scripts - Compile ZScript - Import. Compile. Assign the script to an FFC slot
If this is the first script you are adding:
copy this script to a notepad
add this as the first line:
import "std.zh"
save as a .Z file (save as type All files)
Tools->Scripts - Compile ZScript - Import. Compile. Assign the script to an FFC slot
on the screen where you want the enemy,
Data->Freefrom Combos. Choose one, Edit.
Data Tab: Choose an invisible combo (NOT COMBO #0). Xpos,Ypos the cords you want your enemy to appear at (I can add in a random appearence if you like)
Script drop box, choose the script slot number you assiged this script to
Flags: Check 'Run script at screen init'
Arguments tab: D0: Enemy ID
Good to Go :)
ok... lol ill attempt to understand this
... i just died a little inside...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"
--Andross Maximillion Remedy
(otherwise known as Rem)
Ooh... some nasty puzzles could be done with this... Could you make one that does the same thing, except with the directions the enemy moves reversed (as in, you move left, it moves right)?
Actually that is what it does now. Just like the Green/Red Goryia 2 in LttpCould you make one that does the same thing, except with the directions the enemy moves reversed (as in, you move left, it moves right)?
Ooooooohhh!! Oooh! How about for weapons they fire a a stream of lasers, rapid fire lasers. Like 6 ffc's a second! And, and, use some Ax and Ay action so they bend towards Link's position. Ahahaha!!!
Warp link to the center of a room where he's surrounded by 'em, now that's a puzzle!!!
Good use for if(Abs(this->X == Link->X) + 8//-8){ fire lasers!;}
How about omnidirectional enemy fire?
Ah, Teleporting ffc statues! ..if(Link->InputB){ this->X etc...; }
Hey, you could recreate those Skeletons that jump back when attacked from LTTP. ......Plus make them counterattack! You don't even need ffc life, just keep this->X,Y at enemyNPC->X,Y, and move the enemy accordingly.
I just got a bunch of ideas...Anyway, howabout a variable that allows the user to specify enemy difficulty? If you want to finish the basic script I'd be happy to add much evilness to it.
This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.
umm its not working right...[yes i just got around to testing it] when i try to import the file it says," unable to parse instruction from script mirror enemy ,the error was: invalid instruction, the command was (script) (follower{,)
... im not even in the beginning stages of being able to translate this... can you please explain it?
... i just died a little inside...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"
--Andross Maximillion Remedy
(otherwise known as Rem)
There are currently 1 users browsing this thread. (0 members and 1 guests)