PDA

View Full Version : Okay, I hadn't done anything in a while, but it's all good now.



jman2050
02-26-2008, 12:44 AM
Note: If you think this is feature-adding, well then, that's just your opinion man ;)

Thanks to a post at PureZC in which someone was attempting to make their arrows animate well by overlaying FFCs over them and other weird inefficient crap that made me wonder why people weren't using the built-in weapon sprite handling I put in the scripting engine caused me to go look at the code where I discovered to my chagrin that said weapon sprite handling routines in fact did not exist in ZScript. Go figure.

Anyway, they do now. I'll explain more when the new build comes out, but essentially, there are 2 new types: lweapon and eweapon. The former is for weapon sprites like arrows, bombs, etc that Link shoots. The latter is for weapons that Enemies shoot. They're different groups of sprites to simplify collision detection and such I guess. You'll get to modify stuff like what type of weapon they are, their position, direction, speed, graphics, etc etc. Fun stuff for sure. So can you people PLEASE stop using FFCs as projectiles when this comes out, cause that method really does suck XD

Also I did this because weapon handling was a goal from the beginning, and for some reason wasn't finished. There is still a feature lock on so don't be expecting many other big additions until 2.5 comes out. Yes _L_, I'm talking to you here.

Russ
02-26-2008, 12:58 AM
jman2050, you are a god! Thank you so much for adding this!



There is still a feature lock on so don't be expecting many other big additions until 2.5 comes out. Yes _L_, I'm talking to you here.

:laughing: I have to say, that made me laugh.

Gleeok
02-26-2008, 01:15 AM
Haaaaaaa-llelujah. Hallelujah,Hallelujah. Ha-lle-lu-ooo-jaaaaahhhhhhh!!!!!!!!!!!!!!!!!!!

:heart:

Just in time Jman. These custom weapon scripts were becoming waaaaaay to convoluted for my tastes. Score one for funcionality. Kudos, for whatever purpose it serves.

ScaryBinary
02-26-2008, 08:47 PM
I've always been a firm believer in "procrastination eventually pays off..." :tongue:

So I'll just wait around a bit longer before I try any hefty weapons stuff. :)

Russ
02-27-2008, 12:51 AM
Wait, does this mean it would be possible to make a freeform combo script that would be able to change the graphics for projectiles thrown by enimies on a screen by screen basis? If you, so are amazing! If not, well, you're still amazing for adding such a good feature!

Gleeok
02-27-2008, 02:35 AM
Will the zscript commands be added to the script.txt when the next build comes out, and, lets say you wanted to convert the B button to be a flamethrower :D , Could one be able to spawn a LWeapon sprite with Vx=4 if Link->InputB every 3 frames of gameplay, or the same with EWeapons?

And this next question may seem odd, but what is the max amount of sprites for LWeapon and EWeapon on the screen at once?



..Sounds like fun.

bigjoe
02-27-2008, 03:32 PM
Did you commit your changes? I don't see them on the alpha changelist page.

jman2050
02-27-2008, 04:21 PM
It is now. I screwed up writing the comments so DD had to go and fix it manually.

C-Dawg
02-27-2008, 09:29 PM
How much control over weapons do we have? Spawning, X and Y movement over time, stuff like that? Or just velocity and graphics? In other words, can we spawn player weapons and then manipulate them like FFCs for as long as they persist on the screen?

jman2050
02-28-2008, 01:35 AM
You have full control over weapons as long as they persist on screen (and as long as you create a method to tag onscreen weapons like you would NPCs), but a weapon WILL continue to run the AI of its selected type if you choose to use one of them. So if you spawn a weapon with the arrow type, if you set its speed and dir, it'll move just like a normal arrow would, straight ahead. However, do realize that you don't *have* to use one of the built-in weapon types. If you use a dummy type and set the right variables (more on this in the next build) then you essentially have a 'dumb' weapon that you can control with little impediment, and it'll use the built-in sprite detection for everything else.

And just to clarify, yes, you can spawn weapon sprites at any time.

_L_
02-28-2008, 09:53 AM
And now, let's turn our minds to some implications:
* Take the projectile bomb, the one fired by the Octorok 4. Set its step speed to 0. It is now a proximity bomb that explodes when Link blunders into it.
* I'm looking forward to being able to drop Arrow Sparkles on various things, free of charge.
* And, a way to wash out the nasty Fire Trails prematurely is bound to be nice. Zelda Classic Sunshine.

Russ
02-28-2008, 11:49 AM
* And, a way to wash out the nasty Fire Trails prematurely is bound to be nice. Zelda Classic Sunshine.
Ah, that would be a useful script. I think the best thing would be (if possible, I'm not sure if it is) changing the weapon sprites for enemies on a screen by screen basis. It would allow for much more flexibility.

Pteryx
02-29-2008, 12:44 PM
You have full control over weapons as long as they persist on screen (and as long as you create a method to tag onscreen weapons like you would NPCs), but a weapon WILL continue to run the AI of its selected type if you choose to use one of them. So if you spawn a weapon with the arrow type, if you set its speed and dir, it'll move just like a normal arrow would, straight ahead. However, do realize that you don't *have* to use one of the built-in weapon types. If you use a dummy type and set the right variables (more on this in the next build) then you essentially have a 'dumb' weapon that you can control with little impediment, and it'll use the built-in sprite detection for everything else.

Will there be ways to make it possible to trigger things with custom Link weapons (say, make a Magic Powder item) that can't be triggered by anything else? -- Pteryx