Ammo mechanic is now working as intended... thanks to everyone who helped out!
Only one problem remaining... I've been trying to colour-code various levels of ammo depletion. Tried slot items and decorators, but neither fits the bill.
Ammo mechanic is now working as intended... thanks to everyone who helped out!
Only one problem remaining... I've been trying to colour-code various levels of ammo depletion. Tried slot items and decorators, but neither fits the bill.
Last edited by I_am_a_Spoon; 12th Apr 12 at 9:54 PM.
Can't you add slot_items with the On_Fire_Action? It should work as any other action
The most dangerous distance away from a tank is 200 yards; the safest distance is six inches - Tom Wintringham, 1940
Neither seems to work when using the on_fire action. I can get some actions to work, such as kicker messages, but nothing like slot_items or upgrades. Am I missing something?...
If you apply upgrades through on_fire I'm quite sure they're ending up on the entity, not the squad, so you'll need to adjust your requirements accordingly.
I set the upgrade triggered by the on_fire action to launch a kicker message when successfully applied. In-game, nothing happens... so the upgrade isn't even being applied by the weapon.
I've managed to actions such as received suppression (which affects the squad) and weapon_target_type changes to work, so it seems to me that the on_fire action just doesn't work with every type of action?
Make sure the entity has an upgrade_ext, many don't. If it doesn't, copy it over from an entity that does. No upgrade_ext means can't receive upgrades.
EDIT: Ok, so the actual system works now, but I'm having a little trouble reversing the process when the squad replenishes their ammo.
Long story short... what's the best way to remove up to 500 stacked slot_items simultaneously?
![]()
Last edited by I_am_a_Spoon; 2nd Nov 11 at 12:44 PM.
The circumstances are different in Fortress Europe, as we remove the upgrades (not slot_items) with SCAR, but perhaps you could add a short delay action in the upgrade / slot_item that removes itself?
Well that's the thing, the removal can't be timed, it needs to be done manually by the player via an upgrade.
How hard would it be to code using SCAR?
If you added an upgrade in the on_fire action instead of a slot_item, I am fairly confident that the upgrade could remove itself. I don't think it works with slot_items, though, as they are messier to work with. Just use upgrades, trust me. They are better.
If you are dealing with a conventional approach to COH, as in base building and what not, it might be extremely difficult to setup, as you would have to detect every unit that is produced and then work magic on each one.
Nevermind, all working.
Thanks for the help guys!![]()
2353 ability/upgrade actions.
Last edited by I_am_a_Spoon; 13th Apr 12 at 7:37 AM.
All this made by hand?294 delayed_actions (three tiers), 2059 remove_slot upgrade_actions (4th tier).![]()
I just copy/pasted most of it.
Only problem I have now are the UI decorators. I'm trying to get the squad's level of ammo indicated by a colour-coded icon on their squad tab, but I can't get the colour-changes working properly.
#19
Nice that you found a solution, but next time, try creating a macro for it.
#20
Instead of a color-coded icon you can show the actual ammo count:Only problem I have now are the UI decorators. I'm trying to get the squad's level of ammo indicated by a colour-coded icon on their squad tab, but I can't get the colour-changes working properly.
Try this:
http://forums.relicnews.com/showthre...L-Instructions
Or this:
http://forums.relicnews.com/showthre...splay-UI-Boxes
That's fairly complicated... I'm just trying to make a simple gameplay mechanism. It doesn't need to be that complex.
The icons are colour-coded to mark the approximate percentage of ammo remaining, (green, yellow, orange, red, etc), and are accompanied by a kicker message when triggered. So a player knows he doesn't really need to worry about units with a green ammo icon, but might want to reconsider sending units with orange or red ammo indicators out to remote areas where they can't be resupplied, at least not without ammo carriers.
Another idea could be is, to use the action "ui_decorator_action" in where you can change some textures (icons). Maybe you will need to create some special things to get it to work, like three exemplars of the same icon with three different state colors.
Had a look at the action you're talking about, but I have absolutely no idea how it works...
Me too. After testing some things without any luck, I give up. It seems, this action is used nowhere, so we have no reference. ;(
Quite sure it's used by the Lieutenant's command aura, to apply the stars underneath British troops when an officer is nearby.
EDIT: And also by the command tank. It has some options for animating the images, which creates the radio pulse for the command tank decorator. Also an option to layer on the multiple stars when multiple lieutenants are within range. You'd probably want the later option, which would allow you to have three indicators for ammo. None = no decorator, Running Low = lvl1 decorator, Half = lvl2 decorator, Mostly full = lvl3 decorator.
@sturm: nice find. The command tank uses indeed the "ui_decorator_action". Don't know, why the scan for this action fails. It's a good example.
@spoon: check the ability "captain_force_multiplier_vet2" in "action_list/start_self_actions/action_01". As an idea you coud use a colored version of "units\cmnw_leader_badge_player_outline" instead of the used "units/cmnw_leader_badge_circular_outline". This could be act as the colored (state) background for your unit/squad. Create then for each state a new action with another background_icon.
edit: some additional information. The values for animation_name and art_object_name must be filled or it wont work. These names you can find in "data\art\ui\animations\decorators.lua". There are all animations specified. You can't add a background color for the squad symbol this way (I have tried it), only an additional badge symbol (animated) is possible. Try whether you like it.
Last edited by Jagdpanther; 11th Nov 11 at 6:47 AM.
Late reply guys... haha.
I got some decorator actions working, but there were two problems:
1) they disappeared when squads were garrisoned.
2) they didn't show up on the taskbar.
I also tried adding slot items instead, but their icons interfered with those of weapon upgrades and weren't being removed properly.
Any other ideas? DB's suggestions are solid, but I haven't got anything like the technical know how I'd need...![]()
I would suggest using SCAR. Also, upgrades are better than slot items because they won't interfere with anything. Just be sure to give each entity the "upgrade_ext", or they won't get them.
Upgrades that do what? Slot item icons and decorator actions aren't really the best options...
For your on_fire_actions. I don't really know what you have going on behind the scenes, but it sounds like you are over-complicating things quite a bit.
I have the actual ammo mechanic working perfectly. All I'm trying to do at this point is colour-code different ammo percentages for each squad on the UI.
Well, as I said, you will probably have to use SCAR. The UI extension would probably suit your needs perfectly.
^ That's like telling a monkey to learn astrophysics. XD
Unfortunately I have no experience with SCAR whatsoever... I'm limited to whatever I can manage in the mod studio.
#34
You can always learn
I started to read up on some of it so at least I can understand it, however writing it from scratch is a challenge![]()
Lua is one of the easier programming languages to learn, mostly because its syntax is very simplistic. I learned from scratch a few years ago!
So the general consensus is that it'd only be possible through SCAR?
Keeping in mind that I wouldn't necessarily need a numerical counter? Something simpler would be fine.
To be blunt... I'm not going to learn two entire scripting languages from scratch just to make an ammo counter. I don't have the time or capability. If it needs to be done through SCAR, I'll either need help or will have to revert to kicker messages and decorators, both of which have flaws.
Well, you are rather limited in what you can do with Mod Studio, as you can only use what Relic made. With SCAR, you can do a lot more. As far as I know, the UI decorators were not really made to stack on top of each other.
What do you mean by two languages? SCAR is Lua.
My bad, thought they were different. I still don't have the time though, I'm a full-time student.
I'm having another problem... when you upgrade a squad with a special weapon and the guy holding it dies, you won't get it back again when you reinforce. This only happens if the squad's expended some ammo though (as doing so adds slot items).
I don't know how the exact mechanic behind this works, but the ammo item doesn't take up a slot, uses a different hardpoint to regular weapons, and under the "weapon" section I've put "default" instead of "squad". I don't know why this is happening... I can only assume that squadmembers are being allocated the ammo slot item instead of the weapon slot item when they spawn.
Can anyone help me with the problem in the post above?
But can upgrades be stacked in the same way as slot items?
Yup. Just be sure that the entities you are giving the upgrades to have an upgrade_ext to receive them. Also, I think there are some variables in the upgrades themselves you will have to tweak, like global and local limits.
There are currently 1 users browsing this thread. (0 members and 1 guests)