Platyping's Promotions and Traits

Aok, just didn't seem so from description :)
 
Yup, but confusion is still very easy, so for a later update (if you're in for it) could add a 'within a 1 tile radius of city to be sue about it ;)
 






1) Artifacts updated with Platypedia
2) Settlers updated with Platypedia
 
I'm currently writing a new ModComp called Enhanced Promotions, which not only adds stuff like promotion tiers and paid promotions via XML (new XML file; PromotionTierInfos, I love it :D) and a few new effects for promotions.

Current ideas:
Code:
<FeatureFirstStrikes>
    <FeatureFirstStrike>
         <FeatureType>FEATURE_FOREST</FeatureType>
         <iFeatureFirstStrikeChances>2</iFeatureFirstStrikeChances>
         <iFeatureFirstStrikes>0</iFeatureFirstStrikes>
    </FeatureFirstStrike>
</FeatureFirstStrikes>

allows units to get first strikes from "hiding" in features

along side the combatstrength promotion stuff I added stuff for pure offense and defensive promotions.

I am thinking about a diplomat tag which means that if you defend a friendly city with a unit with a diplomat promotion, it gives you a boost to diplomacy for "You defended our cities!"

any ideas you can think of? the possibilities are pretty much boundless here, C++ :D
 
If you are doing it via SDK, then of course you can add whatever you like some of which I seen before such as:

1) No escape. Withdrawals don't work for opponents
2) See invisible
3) Become invisible
4) Cross terrain unable to pass before
5) Increased Collateral stuff like Limits and Targets
6) Base Strength
7) Wider Cargo Types, Carrier that can transport bombers?
8) Advanced Air Missions. Air Bombs that destroy buildings beside reducing Defense?
9) Target weakest defender first rather than strongest defender first
10) Hidden Nationality

Enough for you to code 1 month :D
 
quick question, what was your code for the fixed experience requirements?

was it just like:

level * experience for each promotion?

because I need it so that tiers cost a set amount, but that normal promotions out of tiers require the normal amount... so so far I have decided that when a promotion tier is obtained the level doesn't go up and the experience for that tier is deducted, but I can't figure out how I can do the getExpierenceNeededFunction yet
 
Long story short:
Before the defined level, formula same as normal
After the defined level, increase in experience same as increase in experience based on defined level.

Exact codes, can't remember.
Too many mods in my folder, removed some of them :D

P.S.
Experience has nothing to do with number of promotions.
It is solely related to level.
 
:lol: I can imagine...

I'm not if I would get any unwanted bugs but what do you think:

Code:
experienceNeeded = level * exp_for_tier if isTierPromotion() else level * level + 1

then when a promotion is chosen:

Code:
			if (GC.getPromotionInfo(ePromotion).getTierType() != NO_TIER)
			{
				changeExperience(-GC.getPromotionTierInfo((PromotionTierTypes) GC.getPromotionInfo(ePromotion).getTierType()).getCost());
			}
			else
			{
				changeLevel(1);
			}

so the exp is set back... but if I am correct in my understanding this sometimes lead to promotions in the normal tree very soon after... it's a little hard to do...

edit: wrong syntax
 
Frankly speaking, no comments since I don't even understand how the promotion tier is supposed to function :D
 
well the promotions tiers contain bunches of promotions, in order to go to the next tier (and unlock the next promotions) you must obtain all the promotions within the tier that the next tier requires.

so tier I:
promotion a, b, c

tier II:
promotion d, e, f

I can't get to d, e or f without first having all of a, b, c

but with so many promotions in each tier it becomes ridiculous to reach tier V! which is why I want set experience for a promotion within a Tier, and outside a tier the experience increases as normal...
 
of course instead of deducting the cost for the promotion within a tier on promote() I could instead reset the experience back to the previous level

so I'm at level 3, a normal promotion requires 10 xp in total, and a tier promotion needs 6

method a:

when I reach 6xp I pick the tier promotion and 2 xp is taken off, leaving me with 4xp

method b:

when I reach 6xp I pick the tier promotion and my xp is reset back to requirement for the previous level, ie 5xp...

then obviously for level four the xp is reset back to 10xp etc...

which one do you think works best?
 
So what you want is:

Fixed Experience X to learn a, b or c, but new fixed experience Y to learn d, e or f
 
yeah, BUT normal promotions without tiers to use normal stuff.

so for tiers

experience = level * experience_for_tier

and normal is the level² + 1

thinking about it method B is probably the best...
 
The getExperienceNeeded function in GameUtils only defines the XP needed to reach a certain level.
When you reach the new level, then you can select a new promotion, so unless you mess alot in the SDK, it can't let you do b anyway, since you have to reach 10 for level 3 before you can select a new promotion, whether tier or normal.

Thus, the only solution will be rebate style.
Using BTS formula:
Total of 2 XP for first promotion
Total of 5 XP for 2nd promotion
Total of 10 XP for 3rd promotion
Total of 17 XP for 4th promotion

Let's say the XP needed for tier 1 promotion is fixed at 5 XP each.

Now this unit is level 3, XP needed to reach next level is 17 - 10 = 7

Then, if promotion chosen is normal promotion, do nothing new.
So level and threshold increases as per normal.

If promotion chosen is tier promotion, give it a rebate.
If chosing a tier promotion should NOT increase threshold for normal promotion:
1) Reduce level by 1, so that threshold remain the same.
2) Reduce XP by tier promotion XP needed (5 XP)
So you have used up 5 XP to gain a tier promotion, but that does not affect your next normal promotion.

End Result:
Back to level 3, 12/17 XP

Of course, this means that you still have to reach 17 XP to select the tier promotion, even though by right you should be able to learn it at 15.
 
I have used the SDK to prevent a level up, so when a normal promotion is selected the level increases, otherwise the level is the same and the experience on the unit is reduced.

if you take a look in the SDK the acquirement of a promotion does not happen when a new level is reached, just when the experience threshold is reached. Then when the unit promotes he goes up a level... see here if you are interested:

Spoiler :

Code:
void CvUnit::promote(PromotionTypes ePromotion, int iLeaderUnitId)
{
	if (!canPromote(ePromotion, iLeaderUnitId))
	{
		return;
	}

	if (iLeaderUnitId >= 0)
	{
		CvUnit* pWarlord = GET_PLAYER(getOwnerINLINE()).getUnit(iLeaderUnitId);
		if (pWarlord)
		{
			pWarlord->giveExperience();
			if (!pWarlord->getNameNoDesc().empty())
			{
				setName(pWarlord->getNameKey());
			}

			//update graphics models
			m_eLeaderUnitType = pWarlord->getUnitType();
			reloadEntity();
		}
	}

	if (!GC.getPromotionInfo(ePromotion).isLeader())
	{
		/* Babylon 5 Mod - Promotion Cost - Start */
		if (GC.getPromotionInfo(ePromotion).getCost() == 0)
		{
			if (GC.getPromotionInfo(ePromotion).getTierType() != NO_TIER)
			{
				int iCost = GC.getPromotionTierInfo((PromotionTierTypes) GC.getPromotionInfo(ePromotion).getTierType()).getCost();
				
				//changeExperience(-iCost); //method a
				setExperience((getLevel() * getLevel() + 1) + (getExperience() - getLevel() * iCost)); //method b
			}
			else
			{
				changeLevel(1);
			}
		}
		/* Babylon 5 Mod - Promotion Cost - End */
		changeDamage(-(getDamage() / 2));
	}

	setHasPromotion(ePromotion, true);

	/* Babylon 5 Mod - Promotion Cost - Start */
	if (GC.getPromotionInfo(ePromotion).getCost() == 0) testPromotionReady();
	else testHardwareReady();
	/* Babylon 5 Mod - Promotion Cost - Start */

	if (IsSelected())
	{
		gDLL->getInterfaceIFace()->playGeneralSound(GC.getPromotionInfo(ePromotion).getSound());

		gDLL->getInterfaceIFace()->setDirty(UnitInfo_DIRTY_BIT, true);
	}
	else
	{
		setInfoBarDirty(true);
	}

	CvEventReporter::getInstance().unitPromoted(this, ePromotion);
}
 
hmmm actually there is a problem. you can only promote if the experienceNeeded() is passed. but you haven't chosen a promotion yet so no tier to compare to... what a messs.

looks like you're right, I need to try and ammend the system...

edit: the problem with the rebate method is that it still increases the rate for normal promotions, where as the two should remain more constant. You can see why I am having trouble with this :lol:
 
Which is why I said, you still have to reach 17xp rather than reach lvl 4.
Anyway, there is nothing you need to modify in getexperienceneeded part.
It is all simply done onunitpromoted.

Also, since tier promotion xp needed is fixed, it has nothing to do with lvl so I have no idea why you include that in formula.
Whether you are lvl 5 or 10, a tier one promotion still require same xp isn't it
 
Top Bottom