Quote Originally Posted by Tamamo View Post
Yeah that's the problem I'm facing too. ZC was written by PM during the dark ages when a lot of people where still pretty loyal to C Style programming making rewriting this thing a bitch and a half. Which is why I want to gut the weapon code and start from scratch.

So let me ask you this, if you we're to restructure the weapon code, what would you do differently? It would be nice to see it from your perspective.
@Tamamo The only major thing I'd do differently, is rip the Link class weapons into standard *weapons, so that users can create, and manipulate them. I don't have a qualm with how weapons work at present, and I think that adding npcdata and flushing out itemdata are far more valuable to the user.

I have to agree with @Gleeok here. I think this is unwise. Better to make a wholly new class of object and allow people to use it. It also comes off to me as convoluted, not simplified, and the way you've been describing it, would break all compatibility with existing scripts, which is just a 'no'.

Keep in mind that if you write a new weapon system, it won't make it in before 2.6x. I'd write it as a side-by-side, keeping what we have, and adding a new system, especially if I have to make it work with Zscript, as every present aspect needs to be retained, including every bleeping quirk, to avoid breaking lots of stuff. From the sound of this, is is entirely incompatible with the present stuff, and even if it was compatible, the weapon changes will alter their behaviour, which is also a 'no' unless you want to make a huge pile of QRs to ensure quests don't break. (Again, a 'no'.)

If this is purely for 3.x AngelScript 'whatever', then remember that we're doing 2.53 right now, so while it'll be god to prepare some of that 3.x stuff, you're making something that we won't integrate for quite a while, so it'll sit in its own branch and be tested until the time comes to do something with it.

A new object type, we can add support for that in the bytecode, and tables...but until you outline exactly how these new weapon objects would work, and detail the point of them, it's just sounding like lots of extra work for a theoretical performance boost, or easier reading for people used to wacky cpp stuff instead of C-stuff.

Tell us please, exactly what your goals are, other than nt using big case-switch blocks, that we use everywhere anyway. I don't object to a new system for 3.x. I don't even object to an additional system for 2.x, but implementing both the present *weapon stuff, and whatever you're doing side-by-side doesn't have a pleasant flavour.


@Gleeok : I mean to reference an npc via its UID with something akin to LoadNPC(). At present, we can only affect an npc, by using its screen index, which changes. I also need to add typecasting so that a user can read an npc pointer as an int, unless you want to do that. I'm not sure if npcdata will need UIDs, ut I know of no way to write to, or read from any npc data without using the screen index ID.

Being able to do something like uid->X without needing to load the npc from its screen index into a pointer would be wicked useful.

Did you review the files?