• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Upgrading System! NEED HELP!

Status
Not open for further replies.
Level 10
Joined
Jun 16, 2007
Messages
415
I wish to make an Upgrade-System for my game Historic Wars v0.90
The game is like ToK:BC or Civ Wars, you build structures, those spawn units for a pc-player which automatically attack your opponents base.
Now what I want to do is, that you can buy upgrades for buildings, that then improve the units spawned. Like you buy -Improved Firearms- and then the building gets it as an item and every unit spawning from it, gets it put into his inventory automatically. Whereas the -Improved Firearms- also give +10dmg and dont drop on death, and cannot be dropped from the building. I figured you can make it undroppable and not drop on death, but when I put into the buildings 'sold items' -Improved Firearms-, it doesnt sell them?

Download the map here: http://hiveworkshop.com/forums/attachment.php?attachmentid=7923&d=1182005968
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Dont sell it, or whatever.

Just, when you create a unit, add (item in slot 1) of the building spawning it to that unit, same with slot 2 to slot 6.

Something like this;

<point> is a global Point variable. in the Custom Script, just replace udg_<point> with your variable's name, prefixed by udg_

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick Every unit of type Barracks and do multiple actions
    • Loop - Actions
      • Set <point> = <where to spawn the unit>
      • Unit - Create 1 Footman at <point> for (Owner of (Picked Unit)), facing <facing> degrees
      • Custom script: call RemoveLocation( udg_<point> )
      • For Each Integer A from 1 to 6, do actions
        • Loop - Actions
          • Hero - Create 1 (Item-type of (Item carried by (Picked Unit) in slot (For Loop Integer A))) and give it to (Last Created Unit)
 
Level 10
Joined
Jun 16, 2007
Messages
415
thanks for the help, but I already had that part worked out, my problem is the buying of the upgrades, not the equipping of the units with it.
Cause if I add an upgrade as an item for a unit under 'sold items' then it doesnt sell it in the actual game, why i dunno:confused:

Also, even if it would sell it'd still have the problem that it would not sell it to the building, but drop it next to it, and it has to be undroppable, to prevent abuse.
Thanks anyway, if someone knows how to make it, that the unit sells the upgrade into its own inventory, that'd be great.
And I still dont get why it doesnt sell it???
 
Level 10
Joined
Jun 16, 2007
Messages
415
ok, that fixed itself after i just deleted the unit and made a new one, but now i have a freakier problem...
i cant make the building sell the item to itself, it can only sell it to another unit or drop it on the ground, but when you drop it, you cant order it to pick the item up with triggers, neither can you move the item into his inventory, except if the player picks it up in the game, which would be kinda lame...:bored:
 
Status
Not open for further replies.
Top