PDA

View Full Version : Various Scripts



C-Dawg
05-21-2007, 12:34 PM
This is a cross-post to highlight the scripts you can go get from the Zodiac demo I posted in the Discussion forum.

The thread is located here: http://www.armageddongames.net/forums/showthread.php?t=97366

There are about 26 scripts in the un-passworded quest linked there. Some of the highlights include:

SIDE-SCROLLING ---

1. Side-scrolling script does the following: (1) allows the player to jump pressing "L"; (2) increases jump height if the player has the high-jump item, currently assigned to the Roc's Feather; (3) allows double-jumping if the player has the double-jump item, currently assigned to the Whistle; and (4) accellerates left and right movement while the player holds R if he or she has the dash item, currently assigned to the Letter, uses magic; and (5) steadily refills the player's magic meter over time.

CUSTOM BOSS --

1. Various versions of the enemy ghosting function. Some use this_ffc-> instead of this-> to get around, some trigger screen warps or combo changes when the enemy dies, etc. The functionality is described pretty well by the comments.

2. Various boss movement patterns. Diving, orbiting, chasing (on the ground or in the air), etc. The most advanced one yet is a simple air chasing script that stops and moves a fire enemy to the ffc when the combo cycles enough- the effect is a boss that zips around, then pauses and opens to reveal a vulnerability.

UTILITY --

1. The bubble spawn script that creates enemies when a combo becomes walkable. Used for enemies hiding in the sand, or re-creating those tadpoles from MM3 Gemini man.

2. Recharging script that fills arrows, life, magic, and bombs while you're standing on the ffc.

3. Shoot-em-up script that spawns enemies and arrow refills at regular intervals.

And many more.

Din
05-21-2007, 05:54 PM
Wow C-Dawg, this is one great quest! I thought half of the stuff you did in this quest wasn't possible with ZC!:)

C-Dawg
05-21-2007, 05:59 PM
Wow C-Dawg, this is one great quest! I thought half of the stuff you did in this quest wasn't possible with ZC!:)

That's kind of what I do.

Seriously though, the real kudos go to DarkDragon, _L_, Jman, and the others who have put scripting into ZClassic. ZClassic is not just for kids anymore.

-C

Din
05-21-2007, 06:02 PM
Thanks to everybody who helped with this quest!

C-Dawg
05-22-2007, 12:11 PM
You should have the basic tools you need to make a megaman or metroid style quest now. The general jump function has so many hard-coded variables to mess with (jump power, air time, pausing in the air at the top of the jump, etc) that you can probably adjust it to recreate jumping from a game you're more familiar with.

I'll eventually be messing with the dash function so that it gives you a "burst" of speed more like MegaManX than just increased movement. I also plan on adding wall jumping or clinging capabilities, which shouldn't be much harder than adding another statement in the "if" block that checks whether the player can jump.

C-Dawg
06-24-2007, 05:34 PM
Updated the quest file with numerous new scripts, including: Ice slipping, enemy freeze rays, and Ice Beam.

C-Dawg
07-17-2007, 12:40 AM
Quest file updated again, with numerous new scripts, including: Wave gun, Spread gun, blade weapon, wall clinging (Added functionality to general 2-d script), pursue_on_a_radius, ffc get between other ffcs (like a chain), enemy rapid fire gun, uh... and some others.

Gleeok
09-07-2007, 04:10 AM
Of course you don't need me to tell you that these scripts are totally amazing, (even though I just did) But I can't seem to get the ffc pursue_player script to work...at all in fact. I basically ended up plastering ex 1st qst with tons of screens using this script with different combinations of variables and nothing. Could you go into a little more detail with how this one works, or point me to an example screen in Zodiac that uses it?

-thanks.

C-Dawg
09-07-2007, 11:53 AM
Well, first make sure you're not using the old pursue_player that didn't use the this_ffc workaround. If you are, it won't do anything unless it's FFC1.

What I usually do is set FFC2 to be an invisible FFC running the pursue_player script. Then the variables get set, if I remember correctly:
1. The number of this ffc, or 2
2. The accelleration of this ffc in hundreths, so like 3 or 4
3. The top speed of this ffc, usually 2 or 3
4. Whether this ffc is stuck to horizontal movement (1 for yes, I think)

Then I set up four or five other ffcs over the invisible one and tell them to follow FFC 2. You can see this script running on the very first miniboss in Zodiac, that jellyfish-insect thing in Aquarius.

Note that the pursue_near_player script does basically the same thing, but allows you to offset the FFC's target so it tries to position itself above or next to the player. Good for shooting enemies. Pursue_near_player is also a more recent and better written version.

Gleeok
09-07-2007, 09:15 PM
Ah yes, I see it now. Pretty useful script, not just for enemies too. Apparently I wasn't setting the "A" arguments to 1. I never had to set those before though, ...actually I don't even know what they do. hmm....
Thanks again.

C-Dawg
10-12-2007, 02:43 PM
Zodiac has been updated again. I'm focusing on the shoot-em-up stages now, and I've implemented the following scripts people might find useful:

1. Added rapid fire functionality to the general weapon script. You can now make any custom weapon fire continously while the button is held down by making small modifications to the script.

2. General shoot-em-up enemy spawner. The script runs on an FFC. When the FFC is set to a certain combo, it will set up your ghosted enemies, including projectile shooting enemies, and move the FFC accordingly. Hit points and taking damage and all that are also implemented. Note: as written, a given combo will specify a given enemy (movement, hit points, etc). You can easily add your own custom enemies by adding if statements to the script.

3. Shoot-em-up enemy plan. The plan simply assigns FFCs running script #2 above to particular FFCs at particular points in time. You could do this in a variety of ways, but the simpliest version is just a linear progression spawning enemies as you fly along.

Din
10-12-2007, 03:12 PM
Thanks, smash brothers' very own samus will have that rapid fire script!

Gleeok
11-16-2007, 04:16 AM
C-Dawg, you should optimize a few of these scripts. Basically any ones that are using while enemy loops, as I've found this certain effect to be the greatest cause for slowdown in zc for some reason. For example, the GW ffc script I'll quote what I changed:



// collision detection


if(this_ffc->Data >= 6){ // to counteract the fucking engine slowdown



}// end of collison detection

} // end optimization of zc engine slowdown

That way it's not constantly checking enemies every frame when it's not in use or on standby. It's not much but I noticed an increase in performance by up to 300% when not in use and up to 5fps when it's active...which is kinda odd..I also added a waitframe every 5 frames if there are more than 20 enemies on screen...but that's pushing it, and is only useful for me probably.


And also; Holy chit man! I really should check out these updates more often...seriously. Good work.

PS- Amazing charge script, i'm gonna have to use that one somehow.

C-Dawg
11-16-2007, 10:57 AM
Yeah, alot of my code needs some optimization and cleanup. Especially the code I'm adding to as I go.

I'm not sure what you changed in your example though. Whats the GW script? What particular bit did you change?

And what computer are you using? The only time I've had slowdown problems since DarkDragon fixed the subscreen writing code was when I was running 32 scripts on a single screen.

Gleeok
11-16-2007, 09:17 PM
Oh, I forgot you have like 20 scripts with those lines somewhere in it. :googly:

I meant the General Weapon script, since it's running non-stop for the entire game. I actually went into Zodiac and added those two lines, and it made a noticable difference for me. I've got a 1ghz pent III, 512 ram. I just seems to be the enemy checks that lag after DD fixed the other stuff. Even the script I made where it creates 255(or max)enemies and centers them at Screen enemy(1) every frame runs at 60 fps. It's like: *if(this->X + 8){}* lags more than *this->X+8;* or something for some reason. Thing is only scripters are really using this stuff right now so there's like 5 people tops messing with this stuff. Anyway....

Seriously, that charge script is flippin awesome. :) And I'm sure i'll be asking you about that jump script really shortly. I would like your opinion on something though: I was going to take Beefsters roll script and add it to your jump script so if Link->InputDown + jump, then he would slide...or could your dash script be a better choice for this?
..and yep, there will be a demo shortly once I get around to scripting turrets.:D

C-Dawg
11-27-2007, 12:24 PM
I would like your opinion on something though: I was going to take Beefsters roll script and add it to your jump script so if Link->InputDown + jump, then he would slide...or could your dash script be a better choice for this?
..and yep, there will be a demo shortly once I get around to scripting turrets.:D

Depends on the behavior you want. If you're looking to emulate Megaman's slide, you probably want to use Beefster's dash because it changes the player's tile and forces the player to move. All my dash script does is accellerate vertical movement.

The_Amaster
12-02-2007, 12:20 AM
Hey C-Dawg, how can you modify your ice block script to apply to top-view? if at all.

C-Dawg
12-02-2007, 04:29 PM
It'll work fine in sideview as is. However, it will "write over" your walkable tiles. So you need to modify it to remember what combo was under the ice, or put your walkable tiles on the background layer.

The_Amaster
12-02-2007, 08:35 PM
Yeah, but I need it to work in top-down, like a standard quest.

C-Dawg
12-02-2007, 09:02 PM
Yeah, but I need it to work in top-down, like a standard quest.

You're not making any sense.

The script doesn't care if you're doing sideview or not. It just shoots ahead until it hits a solid block or enemy and then changes the closest walkable combo to an ice block. What part of this are you concerned about in bird's eye perspective?