Request: code to add buildings that autoproduce units

Like in the game Z

Information and discussion for custom maps and mods.
Post Reply
noobmapmaker
Posts: 1086
Joined: Wed Dec 10, 2014 11:59 am

Request: code to add buildings that autoproduce units

Post by noobmapmaker »

Back in the days I used to play Z. If you dont know it, check this youtube movie with gameplay.

In Z the players capture territories by walking onto a flag. If a productionfacility happens to be in that territory it will start producing units. They don't cost money, they just pop out periodically (and sometimes you can set the factory to producing tanks or switch to infantry groups if you want to).

Just like an oil derrick I think it would be pretty nice to have some kinds of weird barracks or a little town on maps that engineers can capture. If you have captured them they will produce an infantry every 1 minute, for example.

So who is able to write code that changes a Neutral Barrack (or the prison or whatever building) into a CAPTURABLE building that PERIODICALLY spits out a unit? It would be a nice addition to maps, just like the oild derricks.
Playlist with ALL games of the Dark Tournament Youtube.com/CorrodeCasts
Consider supporting OpenRA by setting a bounty or by donating for a server

Henry_the_Slav
Posts: 10
Joined: Wed May 04, 2016 9:23 am

Post by Henry_the_Slav »

I think I can do it in lua. If you check how units are produced in missions, it would be same loop, but always calling itself at the end, and it would have to check for owner at the time unit is to be created. Otherwise it would be a copy of barracks code-wise.

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

I'm actually planning to code a trait like that to reimplement ZH Reinforcement Pads. Notsure if I'd commit it up to upstream OpenRA though, it sounds out of scope for the main project.

That and I have no idea atm how messy it'll look in the end. Besides, I also tend to be slow on actually implementing the things I plan and do want to do, so take this with a grain of salt.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

noobmapmaker
Posts: 1086
Joined: Wed Dec 10, 2014 11:59 am

Post by noobmapmaker »

No rush, do important stuff first!

Ill open it as a feature in github for the map editor. Think it really is a fun addition, just like the oil derrick is a nice monetary aid, this would be a small reinforcement aid.

But how should they work? Generate random infantry? Or always rifle? Or a warfactory: what kind of tank?

Would be great if there was a visual feature that shows that it is a reinforcementbuilding.
Playlist with ALL games of the Dark Tournament Youtube.com/CorrodeCasts
Consider supporting OpenRA by setting a bounty or by donating for a server

Mike_
Posts: 12
Joined: Mon Jul 23, 2012 5:44 pm

Post by Mike_ »

Hi !
Two years ago i have coded first part of my idea:
http://www.sleipnirstuff.com/forum/view ... torder=asc

It looks like "slow z". This Mod was based on TD official mod.
And it does'nt work now (

Here is Lua from this mod. It produced different units for different buildings types:
https://yadi.sk/d/jCtr1mO7rxFVM
(chose English language in the bottom)

When player selected another unit to produce - lua replaced selected building )))

----------

Developers of OpenRa core refused to implement some little (several lines of code !) functions in the OpenRa core for my "map-mod", so now i found Unity3d indie developers to implement my ideas.
Last edited by Mike_ on Tue May 24, 2016 2:02 pm, edited 2 times in total.

Mike_
Posts: 12
Joined: Mon Jul 23, 2012 5:44 pm

Post by Mike_ »

traits to implement ExternalCapturable in CnC mod (for E1 infantry):

defaults.yaml
---------------

^Building:
........ExternalCapturable:
........ExternalCapturableBar:


infantry.yaml
----------------
E1:
........ ExternalCaptures:
................Type: building


(replace dots to tabs)

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

Well, yeah, because you were unreasonable, Mike. I was there, you remember? You demanded everything in an instant and was unwilling to take compromises or anything alike that. You refused to listen first.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

Mike_
Posts: 12
Joined: Mon Jul 23, 2012 5:44 pm

Post by Mike_ »

Graion, sorry, but i can't remember the details of our conversations (((
It was long ago and i had conversations with several developers.

I asked for two things:
1. Create trait in CnC mod, , that unit's weapon damage can depend on unit's current helth.
2. Create possibility to overwrite terrain type for some terrain tiles in "mod-map"


But there was another bad thing. After creating my mod version 0.1 I realized, that current OpenRA pathfinding model is bad for my mod. Units must not try to avoid other units. It works horrible in the battles near narrow mountain passes.


Now it's better to me finish my russian friend's Unity3d project. THis way i can understand what is good and wrong with my ideas.

Post Reply