Jump to content

Photo

Creating custom swords and wands


  • Please log in to reply
56 replies to this topic

#1 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 29 July 2013 - 04:55 PM

So, I'm getting back into working on my quest project, and I'm still at a bit of a roadblock regarding custom items in my game. Simply put, as it's planned out, there are four "wand" items, a fire rod, an ice rod, a wind rod and the normal wand (well, actually, there are two others, but those are just different tiles for the lens of truth and cane of byrna). Now, the nature of these items is that they change the magic fired by the wand, so I can't use all of them at once, So, what I'm looking for is information on how to custom-build wands and swords in ZScript, so I can attach the scripts to custom item classes, instead.

 

 

Oh, yeah, I guess most of them could be used as swords, but I don't know how I'd go about doing that or if I'd be able to use any of them as "B" button items.



#2 Aevin

Aevin

  • Members
  • Pronouns:He / Him
  • Location:Oregon

Posted 29 July 2013 - 06:57 PM

Here's an example of a very basic projectile item script, which simply fires a projectile weapon (called an lweapon) of your choice in the direction Link is facing.  Currently, it's set to use the "magic" lweapon type. The type you choose will have all the properties of that specific lweapon. For example, the magic type will burst into flame on contact if you're carrying the book, and sword beams will burst apart at the edge of the screen.

 

The premade lweapon projectile types are "LW_MAGIC", "LW_ARROW", "LW_BEAM" and "LW_FIRE".  You can also use "LW_SCRIPT1", "LW_SCRIPT2", etc, but getting them to hit triggers is tricky. 

 

I'm sure my code is sloppy, and it doesn't include Link's action animation for when he uses a wand, but it should serve as a very simple template for making basic projectile weapons with no special effects. I hope it's helpful. To use, simply fill every instance of "LW_MAGIC" with the lweapon type you want to use, replace every instance of "magic" with a simple projectile name, rename the script itself, and fill in the values as commented on each line. Even if you don't use it, hopefully it'll show you the basic idea.  Maybe you can use the comments and my explanation to modify one of the other scripts, or something.

Spoiler

Edited by Aevin, 29 July 2013 - 07:00 PM.


#3 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 02:31 AM

Thanks, that helps a lot, actually. I should be able to tweak the existing scripts, now, I think. Actually, I'm getting quite a few new ideas. You said that LW_SCRIPT1, etc were hard to make activate triggers, is that only for existing triggers, or could you make triggers that work with them? Cuz I just had an idea of replacing the fire rod (I have 2 other fire items, anyways) with an earth rod that shoots out a rock that (ideally) spawns a super bomb explosion on contact, could I do that, or would I have to use custom triggers, or would that not work either?



#4 Aevin

Aevin

  • Members
  • Pronouns:He / Him
  • Location:Oregon

Posted 30 July 2013 - 02:44 AM

Glad to be of help. :)

 

Inside the Zelda Classic folder, there's a file called "sdw_constants.zh".  You can find a list in there of all the lweapon types (I only listed a few of them before).  Since there's an existing trigger for super bombs, you should be able to set that up easily enough using the corresponding lweapon type.  All of them behave differently and have their own limitations, so it's hard to say off hand how hard it would be to get some of them to do what you want.

 

The hard part of using the LW_SCRIPT weapons is that there's no existing triggers for them, so you'd have to make your own.  And while I'm sure that's simple for more advanced scripters here, I find it a little daunting.



#5 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 03:06 AM

Yeah, I knew that was there, lol, I just wasn't sure if I could make a projectile spawn the explosion on contact, or if it would activate the SBomb trigger. I'm thinking, since I have so much involving these rods, already, I'm going to try to scripts some more, and come up with 9: A Rod of Vines that does... something involving plants, I haven't quite decided yet (Not sure how hard it is to make enemies turn into trees), Rod of Flames, Rod of Waves (Not sure what that one's gonna do, yet, either, but it'll do something), Rod of Gales, Rod of Freezing, Rod of Quakes (The exploding rock thing. maybe with some quake animation when used), Rod of Mystery (basically the regular magic wand), Rod of Shielding (repurposed cane of byrna) and Rod of True Sight (repurposed lens of truth). Creating custom triggers will probably be really hard, but it would be nice to be able to have overgrown vines that you can clear away with the forest rod (I'll probably come up with a better usage at some point) instead of rocks with targets on them so you use arrows.



#6 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 04:40 PM

Ok, so I've got one more big problem, I need to make the projectile behave like magic, but not be magic, In other words, I need the projectile to cross the room, then turn into something else on impact. I've been looking through the other weapon scripts like this, and I think it's done with an if/else function in the global, but I'm not quite sure exactly what I'm supposed to do. Basically, I'll need scripts that do the following:

 

Forest Magic: Shoots out a green ball of energy. Actually, that's all I need it to do (Was gonna make it stun on contact, where it would, like, turn into vines or something, but.... nah, I'd rather have damage than stun), I think I just need a trigger so that I can make it clear away "vines" (Basically, just something that triggers secret tiles ONLY when hit with vine magic).

 

Water Magic: Shoots out a ball of water that splashes on contact, it would also need a trigger

 

Earth Magic: Shoots out a rock that spawns a super bomb explosion

 

I don't need the exact scripts, per se, just a general outline of how I would make an LWeapon turn into a different LWeapon on impact, and how I'd make custom triggers. For the most part, I think all the custom triggers I would be using would just be to activate a secret combo, so it doesn't seem like it should be too hard.



#7 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 30 July 2013 - 05:37 PM

I don't know how to script or really anything much about them but what if you set up the trigger to use something that is not used in the game (Like the sword beam triggers), It might be real hard to set that up or it may not, I don't know It was a thought that poped into my head.



#8 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 05:42 PM

seems to me that would require just as much, if not more scripting than making the trigger from scratch, because I'd still need to use scripted projectiles, 



#9 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 30 July 2013 - 05:48 PM

Good point..... you could use swords and set them up like the wands (like setting the beam sprite to what you want it to be) but then you have to sacrifice 1+ sword/s, Though if you don't use Wooden or white sword triggers in the game then it might work  :P.


Edited by coolgamer012345, 30 July 2013 - 05:48 PM.


#10 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 05:54 PM

Yeah, but then I have to sacrifice my sword slot, and use the wands on the "A" button. I'm really picky about keeping everything on the "B" button.

 

But, Yes, that solution would solve my problem, otherwise.


Edited by Lineas, 30 July 2013 - 05:55 PM.


#11 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 30 July 2013 - 05:57 PM

Oh I forgot about that too..... Well you could use the " Can select items too A button" but then some strange things happen and you need to put in a normal sword in their.... and you could not keep the items to the "B" button.



#12 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 06:14 PM

Exactly, It was one of the first ideas I had had, and since at least 3-4 of the wands are going to be re-sprited versions of "B" button items, I didn't want to split them by making some "wands" and some "swords"... Although, I suppose, I COULD massively overhaul the game and turn all of the rods into elemental swords, but then I'd need real purpose for the elemental attacks, rather than just pretty graphics, because I'd need real reason to use one sword over another. And I'd still need to use custom triggers, just because of the sheer number of different triggers I'd need to activate. Plus I'd need new graphics/tiles for all of the swords. But still, that might add an interesting gimmick, I mean, the elements are already a heavily prevalent theme in the game, I suppose I could work out some sort of weakness/resistance chart(like in pokemon or final fantasy), and try to work it into the enemies, Something like:

For fire enemies: Fire sword: 0x, Forest: 1/2x, Water:2x

all other swords do 1x damage, and each element will be part of a ring, Forest, Fire, Water; Wind, Earth, Ice; and Shadow, Spirit, Light

 

That could be an interesting mechanic to add, and it would give a real reason to have all the different swords.

 

I dunno, what do you think?



#13 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 30 July 2013 - 06:24 PM

It sounds really cool to me!



#14 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 06:35 PM

Ok, then.... Now i just have to figure out how in the hell I'm going to make x2 and x1/2 damage attributes for certain weapons on monsters.... And the custom triggers, cuz I need each of the swords to only work on one trigger type. And how I'm going to make multiple levels of each elemental type sword, cuz I wanted upgrading the elemental items to be a big part of the game, as well.


Edited by Lineas, 30 July 2013 - 06:42 PM.


#15 Aevin

Aevin

  • Members
  • Pronouns:He / Him
  • Location:Oregon

Posted 30 July 2013 - 07:15 PM

Well, here's a few ideas of how you might be able to cheat to reduce the number of custom triggers you need to set up.

 

1. Create items of the same class, but multiple levels using item override.  In several cases, I think the different levels of weapons still activate distinct triggers. But in the case of arrows, I know that if you have higher leveled arrows, the lower levels will trip the higher level triggers. However, you can get around this by using block flags, which, oddly enough, still distinguish between the two types of arrows. Since the items are the same class, it will limit your options in enemy defenses, though.

 

2. Use custom enemies in place of custom triggers. You can set up an enemy to look like a trigger, make all of its defenses "ignore" except for the one you want, then set the enemies->secrets flag to have it trip screen secrets. Enemies have a defense for "scripted weapon," which I think applies to LW_SCRIPT1 through 5 or whatever the maximum is. The advantage here is that if you want to have multiple trigger types on one screen, then you don't need to make custom triggers that are compatible with the "self only" flags. The disadvantage is that you can't include other enemies on the screen and it's still limited to the enemy defenses.

 

By the way, it's tough to guess just from forum posts how much people know about scripting, zquest or anything else, so I tend to try to explain even the simplest things in great detail. I'm not trying to insult your skill level or anything, so please forgive me if it comes across that way.


Edited by Aevin, 30 July 2013 - 07:29 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users