I'm trying to create a Dalek for general use, or any laser-shooting enemy.
The basics are that I need to be able to set the walk style, the enemy combo, and the other normal enemy specifics.
The key difference is that the enemy, when you are anywhere in its line of sight (which should be a parameter: front, back, side l, side r, and area) will target you and shoot a laser beam like a beamos,.
I can settle for front-only line of sight firing.
If anyone wants to contribute to this, I'd appreciate it.
Walking beamos-type enemy.
Started by
Timelord
, Apr 16 2013 04:34 AM
6 replies to this topic
#1
Posted 16 April 2013 - 04:34 AM
#2
Posted 16 April 2013 - 09:54 PM
I could edit my beamos script to make the enemy move, or I could make this Dalek from scratch. If you give me the specifics for how it should work (exactly, and can be however you like), I'll make you the script in exchange for your Dalek sprites. I think I'd like to use that, too....
#3
Posted 17 April 2013 - 12:51 AM
Sounds good to me. The Dalek sprites are in the quest (HERE); I can send them as an export if you want, or make revisions if you'd like. that quest has them in action...IIRC on Screen 00x13, and in the enemy editor as the enemy type Dalek.
Essentially, they should work as they are in the quest, with an adjustable speed and homing setting; the major difference is that they should fire a greenish laser beam from the tip of their weapon to the target (Link); if it misses, it should extend to the screen edge.
I think the beam tip and beam edge could probably have different damage (direct hit or glancing blow) and the beam damage obviously needs to be a setting. I could be horribly cruel and make it an instant kill shot, or be fair because it is a game.
The Dalek is shielded on L/R/B, but not on the front. I would prefer it vulnerable to projectiles (so that it is weak to guns later) and explosives, but strong against almost everything else. I have yet to get autopghost to work correctly, so I don't know if the standard enemy weakness/strength rules apply to autoghosted enemies.
Maybe you could figure out why autoghost is causing the MP drain when added; I wasn't able to get it to work. (The script is HERE; combining the global scripts seems to be the issue of the week for me.)
I also tinkered a bit with your Super Light Arrows and attached them to my Bolt! spell item; I need to figure out how to change the beam size and colour of that next.
I can export the tiles (loose) for the Dalek if you wish; if you want more frames for it, let me know. I will likely make several versions of the sprite, and some other DW enemies (e.g. Cybermen), so having walking enemies that shoot laser weapons would be nice overall.
If you try the quest, go down one screen and right three and you'll see how they look at present. I went for a hybrid of the modern and classic style casing that fits into the classic tileset. It's hard to get them to look perfect without sacrificing some detail in this palette, so if you want a better version for a specific graphics set, just let me know which one you want and I'll draw them.
Essentially, they should work as they are in the quest, with an adjustable speed and homing setting; the major difference is that they should fire a greenish laser beam from the tip of their weapon to the target (Link); if it misses, it should extend to the screen edge.
I think the beam tip and beam edge could probably have different damage (direct hit or glancing blow) and the beam damage obviously needs to be a setting. I could be horribly cruel and make it an instant kill shot, or be fair because it is a game.
The Dalek is shielded on L/R/B, but not on the front. I would prefer it vulnerable to projectiles (so that it is weak to guns later) and explosives, but strong against almost everything else. I have yet to get autopghost to work correctly, so I don't know if the standard enemy weakness/strength rules apply to autoghosted enemies.
Maybe you could figure out why autoghost is causing the MP drain when added; I wasn't able to get it to work. (The script is HERE; combining the global scripts seems to be the issue of the week for me.)
I also tinkered a bit with your Super Light Arrows and attached them to my Bolt! spell item; I need to figure out how to change the beam size and colour of that next.
I can export the tiles (loose) for the Dalek if you wish; if you want more frames for it, let me know. I will likely make several versions of the sprite, and some other DW enemies (e.g. Cybermen), so having walking enemies that shoot laser weapons would be nice overall.
If you try the quest, go down one screen and right three and you'll see how they look at present. I went for a hybrid of the modern and classic style casing that fits into the classic tileset. It's hard to get them to look perfect without sacrificing some detail in this palette, so if you want a better version for a specific graphics set, just let me know which one you want and I'll draw them.
#4
Posted 17 April 2013 - 02:52 PM
Haven't gotten to the Dalek yet, but I noticed some severe problems with your script:
1. The indentation is HORRIBLE. I recommend getting Notepad++, installing its TextFX plugin in the plugin manager, and using TextFX->TextFX Edit->Reindent C++ code.
2. You made two different copies of my magic healing script, when you should be using arguments. You can set the MP cost in the item's D0 and the HP gain in the item's D1. You also did this with the scripts called "MCP".
3. You converted an item script to a global script (that one that boosts max MP). I'd recommend removing that and re-enabling the item script, or better yet just making the item a magic container item.
Your script with slight improvements (including removing redundant scripts mentioned in #2).
1. The indentation is HORRIBLE. I recommend getting Notepad++, installing its TextFX plugin in the plugin manager, and using TextFX->TextFX Edit->Reindent C++ code.
2. You made two different copies of my magic healing script, when you should be using arguments. You can set the MP cost in the item's D0 and the HP gain in the item's D1. You also did this with the scripts called "MCP".
CODE
item script heal6heart{
void run(int m, int h){
if(Link->MP >= m && Link->HP < Link->MaxHP){
Link->HP += h;
Link->MP -= m;
Game->PlaySound(39);
}
else{
Game->PlaySound(errorsfx);
}
}
}
void run(int m, int h){
if(Link->MP >= m && Link->HP < Link->MaxHP){
Link->HP += h;
Link->MP -= m;
Game->PlaySound(39);
}
else{
Game->PlaySound(errorsfx);
}
}
}
3. You converted an item script to a global script (that one that boosts max MP). I'd recommend removing that and re-enabling the item script, or better yet just making the item a magic container item.
Your script with slight improvements (including removing redundant scripts mentioned in #2).
#5
Posted 20 April 2013 - 11:38 PM
Okay, made the script! Here you go.
I couldn't open your quest, however. Could you export the loose tiles for me? It's Quest->Graphics->Tiles->(correct tilepage)->Export.
Script
I couldn't open your quest, however. Could you export the loose tiles for me? It's Quest->Graphics->Tiles->(correct tilepage)->Export.
#6
Posted 21 April 2013 - 08:38 PM
Yes, I will send you the loose tiles for the present 4-Frame version, and some more later, including an updated 4-frame and an 8-frame version. I'll check out thee script presently. Thank you very much!
I uploaded the loose tiles and a revised .qst file for you here.
The Dalek/laser shooter script has a couple issues: The beam remains on-screen when the enemy is moving, so when the Dalek moves, the beam stays put, leaving a weird blue line; the second problem is that walking into the side of the beam does no damage (unless there is a way to set that).
If you can load the quest file, you can see them in action. Let me know if I did something wrong...
I uploaded the loose tiles and a revised .qst file for you here.
The Dalek/laser shooter script has a couple issues: The beam remains on-screen when the enemy is moving, so when the Dalek moves, the beam stays put, leaving a weird blue line; the second problem is that walking into the side of the beam does no damage (unless there is a way to set that).
If you can load the quest file, you can see them in action. Let me know if I did something wrong...
Edited by ZoriaRPG, 22 April 2013 - 10:04 AM.
#7
Posted 26 June 2013 - 09:48 AM
This is the updated script, in case anyone else wishes to use it:
Data 1
HP 40
Damage 2
WDamage 4
Random Rate 8
Halt Rate 4
Homing Factor 180
Step Speed 40
Pal Cset -1
F. Rate 16
Weapon: None
Type: Walking Enemy
E-Anim: 4-Frame, 4-Dir
Data 2
Shot Type: 1-End-Halt
Death: Normal
Death Attr. 1: 70
Death Attr. 2: 1,000
Death Attr. 3: 120
Extra Shots: 31
Effect Strength: 61 (My soundset)
Walk Style: Normal
Walk Attr.: 0
Misc. Attr. 11: -1
Misc. Attr. 12: 13
Misc. Flags
Shielded on Left
Shielded on Right
Shielded on Back
Defenses 1
Boomerang: Stun or BLock
Bomb: None
Superbomb: None
Arrow: Block if <6
Fire: Ignore
Wand Melee: None
Magic: Block
Hookshot: None
Hammer: None
Defenses 2
Sword: None
Sword Beam: None
Reflected beam: None
Reflected Magic: None
Reflected Fireball: None
Reflected Rock: Block
Stomp Boots: Block
Byrna Beam: Block
Script Weapon: None
/////////////////////// //// THE DALEKS ///// /////////////////////// //Type: Walking Enemy //Weapon: NONE //Death Attrib 1: Angle of vision //Death Attrib 2: Shot step speed //Death Attrib 3: Cooldown between shots //Extra Shots: Type of weapon to use; determines if it gets blocked by walls or different shields (see the EW_ section of std_constants.zh) //Touch Effects: NONE //Effect Strength: Shot SFX //Misc Attrib 11: First of 4 walking combos (up, down, left, right), or -1 to use enemy editor sprite //Misc Attrib 12: Number of FFC script slot with this script //"Shielded in ___" flags will work ///////////////////////// ///For Classic Tileset/// ///////////////////////// const int WLS_LASERCOLOR = 181; //Color of the laser beam: [CSet# * 16] + [Color within CSet from 0 to 15] const int WLS_LASEROPACITY = 90; //128 = Opaque, 64 = Transparent const float WLS_LASERSIDEDAMAGE = 0.5; //Percent damage dealt by touching side of beam (0 = disable) /////////////////// ///OTHER OPTIONS/// /////////////////// //Dalek beam colour choices 98 - 147 - 182 //const int WLS_LASERCOLOR = 81; //Color of the laser beam: [CSet# * 16] + [Color within CSet from 0 to 15] //const int WLS_LASEROPACITY = 128; //128 = Opaque, 64 = Transparent //const float WLS_LASERSIDEDAMAGE = 0.25; //Percent damage dealt by touching side of beam (0 = disable) ffc script walkingLaserShooter{ void run ( int enemyID ){ npc ghost = Ghost_InitAutoGhost(this, enemyID); Ghost_SetFlag(GHF_NORMAL); Ghost_SetFlag(GHF_4WAY); //Get attributes int angleOfVision = ghost->Attributes[2]; int shotStep = ghost->Attributes[3]; int shotCooldownTime = ghost->Attributes[4]; int weaponType = ghost->Attributes[5]; //Attributes[4] is a drop-down box int shotSFX = ghost->Attributes[7]; int shotCooldown = shotCooldownTime; int turnTimer = ghost->Rate * 10; int laserStartX; int laserStartY; eweapon beam; while(Ghost_HP > 0){ //Shooting if ( shotCooldown > 0 ) shotCooldown--; //Only one beam at a time else if ( !beam->isValid() ){ //If Link is within this angle if ( LinkInAngleOfVision ( ghost, angleOfVision ) ){ shotCooldown = shotCooldownTime; laserStartX = CenterX(ghost); laserStartY = CenterY(ghost); beam = FireAimedEWeapon(weaponType, laserStartX, laserStartY, 0, shotStep, ghost->WeaponDamage, 0, shotSFX, 0); beam->DrawXOffset = 999; //Draw off-screen } } //Draw laser beam if ( beam->isValid() ){ Screen->Line(4, laserStartX, laserStartY, CenterX(beam), CenterY(beam), WLS_LASERCOLOR, 1, 0, 0, 0, WLS_LASEROPACITY); //Beam side damage if ( WLS_LASERSIDEDAMAGE > 0 //If side deals damage && LinkInAngleOfVision ( ghost, angleOfVision ) //And Link is still in angle of vision && DistanceLink(ghost) <= Distance(beam->X, beam->Y, Ghost_X, Ghost_Y) //And is within beam length ){ //Fire invisible, unblockable, undetectable weapon at Link eweapon beamExtra = FireAimedEWeapon(EW_SCRIPT1, laserStartX, laserStartY, 0, 9999, ghost->WeaponDamage * WLS_LASERSIDEDAMAGE, 0, 0, EWF_UNBLOCKABLE); //It will leave the screen almost instantly beamExtra->DrawXOffset = 999; //Draw off-screen } } // //Change direction // turnTimer--; // if ( ghost->Step > 0 && turnTimer <= 0 ){ // //Home in on Link // if ( ghost->Homing > Rand(256) ){ // int angle = RadianAngle(ghost->X, ghost->Y, Link->X, Link->Y); // Ghost_Dir = RadianAngleDir4(angle); // turnTimer = ghost->Rate * 10; //Reset turn timer // } // //Otherwise pick random direction // else{ // Ghost_Dir = Rand(4); //Pick a random direction // if ( CanWalk(Ghost_X, Ghost_Y, Ghost_Dir, 10, false) ) //If it can move there, // turnTimer = Rand(ghost->Rate * 10); //Reset turn timer (otherwise try it next frame) // } // } Ghost_Move(Ghost_Dir, ghost->Step/100, ghost->Rate); Ghost_Waitframe(this, ghost, true, true); } } } int Dir4ToDeg(int dir){ if ( dir == DIR_RIGHT ) return 0; if ( dir == DIR_DOWN ) return 90; if ( dir == DIR_LEFT ) return 180; if ( dir == DIR_UP ) return -90; return -1; } bool LinkInAngleOfVision ( npc ghost, int angle ){ //Check angle to Link against angle of vision int angleToLink = Angle(CenterX(ghost), CenterY(ghost), CenterLinkX(), CenterLinkY()); int facingAngle = Dir4ToDeg(Ghost_Dir); int difference = Abs(angleToLink - facingAngle); return (difference <= angle/2); }My settings for a BASIC Dalek are as follows:
Data 1
HP 40
Damage 2
WDamage 4
Random Rate 8
Halt Rate 4
Homing Factor 180
Step Speed 40
Pal Cset -1
F. Rate 16
Weapon: None
Type: Walking Enemy
E-Anim: 4-Frame, 4-Dir
Data 2
Shot Type: 1-End-Halt
Death: Normal
Death Attr. 1: 70
Death Attr. 2: 1,000
Death Attr. 3: 120
Extra Shots: 31
Effect Strength: 61 (My soundset)
Walk Style: Normal
Walk Attr.: 0
Misc. Attr. 11: -1
Misc. Attr. 12: 13
Misc. Flags
Shielded on Left
Shielded on Right
Shielded on Back
Defenses 1
Boomerang: Stun or BLock
Bomb: None
Superbomb: None
Arrow: Block if <6
Fire: Ignore
Wand Melee: None
Magic: Block
Hookshot: None
Hammer: None
Defenses 2
Sword: None
Sword Beam: None
Reflected beam: None
Reflected Magic: None
Reflected Fireball: None
Reflected Rock: Block
Stomp Boots: Block
Byrna Beam: Block
Script Weapon: None
Edited by ZoriaRPG, 26 June 2013 - 10:05 AM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users

