#ifdef NORMAL, HARD
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
Re: #ifdef NORMAL, HARD
If you don't have nightmare, you can simplify this even further:Helmet wrote: ↑December 1st, 2020, 11:28 amPS: I'm still going to use Ravana's solution. Check-out this beautiful crystal-clear code...Code: Select all
#ifdef EASY type=Naga Warrior #endif #ifdef NORMAL_OR_HARD type=Naga Sicarius #endif
Code: Select all
#ifdef EASY
type=Naga Warrior
#else
type=Naga Sicarius
#endif
Re: #ifdef NORMAL, HARD
I've done that often enough, but I don't like it. My code sometimes becomes hard for me to parse, and changing things after playtesting becomes more difficult. Look at this example and quickly determine which unit types are NORMAL...GunChleoc wrote: ↑December 2nd, 2020, 7:13 am If you don't have nightmare, you can simplify this even further:
Code: Select all
#ifdef EASY type=Naga Warrior #else type=Naga Sicarius #endif
Code: Select all
#ifdef EASY
type=Naga Warrior
#else
type=Naga Sicarius
#endif
#ifdef HARD
type=Naga Ringcaster
#else
type=Naga Dirkfang
#endif
Code: Select all
#ifdef EASY
type=Naga Warrior
type=Naga Dirkfang
#endif
#ifdef NORMAL_OR_HARD
type=Naga Dirkfang
type=Naga Ringcaster
type=Naga Sicarius
#endif
That was probably a bad example, but you get the idea. Anyhow, I guess my problem boils down to
#else
. I don't like #else
.When I'm in a restaurant and I need a spoon, I ask for a spoon. I don't ask for the utensil that is not a knife and not a fork.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: #ifdef NORMAL, HARD
Difference for these examples is that NORMAL has Ringcaster in one form but not other.
Re: #ifdef NORMAL, HARD
Use my suggestion... or else!
Of course, whatever works best for you is the way you should do it
Of course, whatever works best for you is the way you should do it
Re: #ifdef NORMAL, HARD
Yay!
I simply don't want to mix-up NORMAL and HARD, etc., that's all. A good chunk of my mistakes arise from mixing things up.
For example:
allow_recruit
and allow_extra_recruit
. Ugg.Also:
team_name
and user_team_name
. Uggggggg.I learned what
unrenamable
did in like two seconds, and I've never make a mistake with it. Why? Because some developer didn't call it something confusing, like name2
.Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.