Command&Conquer style doom game

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Guest

Command&Conquer style doom game

Post by Guest »

so im working on a doom map that will utilize buildings and units from the classic c&c tiberium dawn game. The player will develop a base from structures from their weapon bar or inventory using cash.

I could probably set a variable script for the cash or currency, but for now i might try having it as simply a form of ammo within the hud to see how that handles.

the main trick im trying to figure out so far is how that currency generates.

To try and keep this true to the original RTS, I was thinking of having a custom monster function as a stationary building (a refinery) that the player builds that then generates another custom monster (a harvester) that I then script to go attack (collect) a group of other custom monsters (tiberium/ore) and once it killed (collected) a few, it then returns to the stationary building to trigger another script to give the player a cash variable or ammo amount.

The questions I bring here today is if I do all this via just monsters, is there an ACS way to have the harvester target just the resource monster and ignore other monsters/enemies? Maybe via a tid designation? also idk if there is a way to write into the monster wad for the harvester to only kill a certain amount of resource monsters before patrolling back to the refinery or how I would setup the parent/child relationship between the harvester and refinery building to begin with upon both spawning. The building would spawn from the player which would then spawn the harvester from it.

If the later cant be done with ACS I might fallback on the idea since I am not experienced with zscript yet and Im probably thinking of a complexity beyond the games capability.

Thanks to any who can help!
User avatar
Virathas
Posts: 249
Joined: Thu Aug 10, 2017 9:38 am

Re: Command&Conquer style doom game

Post by Virathas »

Frankly, project like this while possible doable via DECORATE and ACS, would be extremely hacky and inflexible.

However, using ZScript, it is fully doable. Using the harveseter example, you could easily create the building "monster" - that would upon its own completed spawn animation create a monster(harvester) that would use a specialized form of looking for only ore objects. Once found the closest one would be set as the harvester's target, and then would navigate towards it using the classic A_Chase functions (remember, true pathfinding is not in Doom, so any advanced geometry like wall may cause the unit to get stuck). Once it reaches the ore, you could set animation for harvesting, and slowly change preset custom variables in both ore and harvester. On having that variable reach wanted value, the harvester would once again use a specialized search, this time looking for "refinery" monster. And just like with ore, move, and then "transmit" the ore into currency.

Actually, this part should be fairly simple, mostly utilizing BlockThingIterator, SetStateLabel, some preset properties and a little decorate. No ACS.

A risk of using it with ACS and DECORATE, is that you have very poor "target finding" and barely have any pointers.


One more reason why you should do this in ZScript, instead of ACS/Decorate. If you'd like to have a C&C style game, it would probably mean "army vs army" scenarios. And, simply put, Doom AI does not work well with that, so you'd probably need to write your own "Target Acquisition" method.

And, on the bright side, ZScript is actually fairly simple, especially if you have some ACS (or C++) experience.
Post Reply

Return to “Scripting”