[ian-reeds-games] Re: Inheritence doesn't like me

  • From: Craig Brett <craigbrett17@xxxxxxx>
  • To: ian-reeds-games@xxxxxxxxxxxxx
  • Date: Mon, 23 Dec 2013 18:53:37 +0000

Hi Al,

I'm home from work now, so I can give you a sort of mini idea of how to do the inheritence.

First off, you'd take a normal unit. These units are not going to be anything special, just for an example. In my example, I have here a warrior.

Unit
10 // parser version
|flags
description A skilled melee fighter with additional armor and health.
add_skills attack,defend,move,use_item,take_item,give_item,drop_item,equipment
team=1
attack_health_inflict=4
health_max=30
sound=warrior
equip_slots=body|armor
equip_type=warrior
|script_flags

I know, I've extended the getting started maps a little here. Now, say, we want to make a mounted warrior, who has a few more actions, a new attack and a different sound. We could copy+paste, which is what we all used to do and worked fine. Or we could just inherit from warrior, like this.

Unit
10 // parser version
|flags
inherits=warrior
description A mounted warrior who moves faster than a normal warrior. Can also perform the awesomeful charge attack
add_skills charge
actions_max=8
sound=mounted_warrior
|script_flags

This already works. Or at least it does for me. It won't work on structures yet though. Give it a go and see if it plays nice for you. I hope this helps explain what I'm on about.

As for the script, I believe you, I just didn't know it did before. I thought you bringing it to my attention when I released the new scripts was you telling me that they still weren't working. Do you know how whoever fixed it had it working when it did? I don't know much about how to replicate this problem, at least now. Whenever I do transforms in effects, they come off fine. If it's still up there, I guess I'll take a look at the bundle you put together for Ian for when he gets around to looking at it.

Hope all's well,

Craig

On 23/12/2013 08:02, Allan Thompson wrote:

Hi Craig,

I appreciate that about the inheritance stuff and I am looking forward to your new map pack!

Honestly, I wouldn’t have asked if  it didn’t work. Ironically,

Another fellow on the list actually got the old one working, causeing units to transform automatically back after the duration ended. Oddly enough, because he got it working I am now in this dilemma, lol.

Originally I had these units being forced to change thru a negative backlash if the player did not change back. I guess in the end maybe I should reconsider going back to something like that in order to get the new script flags into the map pack, because I very much prefer those, in addition if I understand them right, I will now be able to implement a unit team toggle which is so much eaiser then the way I got it. In addition I want to implement the new stuff into my older map packs etc.

So if it isn’t feasible, then so be it. I just appreciate the work you put into them!

al

*From:*ian-reeds-games-bounce@xxxxxxxxxxxxx [mailto:ian-reeds-games-bounce@xxxxxxxxxxxxx] *On Behalf Of *Craig Brett
*Sent:* Monday, December 23, 2013 2:21 AM
*To:* ian-reeds-games@xxxxxxxxxxxxx
*Subject:* [ian-reeds-games] Re: Inheritence doesn't like me

Hi al,



The inheritance stuff isn't documented, you're right. I got it from one of the update notices emails. In it I think Ian said he hadn't got around to documenting this stuff yet. I think it was dev 28 or somewhere around that mark. Sorry, I dunno if that's accurate. I'm writing this on my phone, so I won't attempt to give my own version of documentation here, but I can try and do it later. And it might not be in my command and conquer maps, since I can't get it going for structures and they're the most obvious candidates for inheritance. I'm starting on a new, not so serious map pack and I've used it there. I'm not very far with it yet, but hopefully to get the first map fully done it won't take me too long.



As for the scripts situation, if you mean the game crashing when certain units transform, I don't think it worked in the old version either, since I remember the weer warrior in particular wouldn't work and that was definitely using the old version of my scripts. I'm not sure downgrading would solve this. I'm not sure how well the old and new scripts would play together. I'm not sure whether to put the time in to make a working old version if it won't actually resolve your problem though.



I hope this makes sense.



Craig


Other related posts: