1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Star Sign modmod

Discussion in 'C2C mod mods' started by strategyonly, Apr 21, 2013.

  1. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    This is a modmod created by Smeagolheart re-made by StrategyOnly and re-designed python by Dancing Hoskuld.

    Some how i had to get the Star Signs into a mod because i believe MOSTLY everything the Ancients did were done by the "stars" themselves. It might just be me, what can i say.

    What is it?

    It is more or less just promotions that are like the name says Star Signs. ie: In Alphabetical order:

    Aquarius, Aries, Cancer, Capricorn, Gemini, Leo, Libra, Pisces, Sagittarius, Scorpio, Taurus, and Virgo.

    What does it do (in order with above reference):

    A: <iExperiencePercent>25</iExperiencePercent>
    A: <iChanceFirstStrikesChange>3</iChanceFirstStrikesChange>
    C: <bDefensiveVictoryMove>1</bDefensiveVictoryMove>
    C: <bAmphib>1</bAmphib> and <bRiver>1</bRiver>
    G: <iVictoryHeal>15</iVictoryHeal>
    L: <iStrengthChange>1</iStrengthChange>
    L: <iUpgradeDiscount>25</iUpgradeDiscount>
    P: <bOneUp>1</bOneUp>
    S: <iFirstStrikesChange>3</iFirstStrikesChange>
    S: <iSurvivorChance>20</iSurvivorChance>
    T: <iVictoryAdjacentHeal>15</iVictoryAdjacentHeal> and <iVictoryStackHeal>15</iVictoryStackHeal>
    V: <iHillsDefense>50</iHillsDefense>

    PYTHON:

    The most important part is the python by the chances it gives:

    Right now they there is a very LOW chance of getting these, because of the uniqueness:

    if chance == 7: ### Lucky 7 Lol -> so 1% chance of getting a "sign promotion" ###

    Example Gemini:

    Spoiler :
    Code:
    elif chance2 == 4:
    				pUnit.setHasPromotion(promSign5, true)
    				szIcon = "Art/Interface/Buttons/promotions/GEMINI.dds"



    Changes for this are welcome, and will be "considered" but maybe not implemented.

    DOWNLOAD HERE
    :
    http://www.gamefront.com/files/23219928/Star+Signs.zip
     
  2. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,321
    Gender:
    Male
    Location:
    Canberra, Australia
    So are you going to add the Chinese and Incan star signs? And if so are you going to restrict them by base culture? Sorry, I meant to ask you that when we were working on it.
     
  3. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,235
    Gender:
    Male
    Location:
    Las Vegas
    Random unit promotions when they're built basically? I like it. But I wouldn't test it until its in the main mod as an option there.
     
  4. LeftBower

    LeftBower Chieftain

    Joined:
    Nov 15, 2008
    Messages:
    56
    Location:
    Nowhere Ctrl
    Mechanical effects from star signs that are inherently connected to one cultural group? I'm against it. C2C seems to be about having all cultural groups be represented, so adding a mechanic that only represents one seems odd. *Maybe* make this random thing a promotion from a religious building, but even then, I'm not so keen.
     
  5. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    fixed
     
  6. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,321
    Gender:
    Male
    Location:
    Canberra, Australia
    Try a lower case u
    Code:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!--
        StarSigns
    -->
    <mod id="StarSigns" module="StarSignsPromotion">
       	<event type="[B][COLOR="Red"]u[/COLOR][/B]nitCreated" function="onUnitCreated"/>
       	<event type="unitBuilt" function="onUnitBuilt"/>
    </mod>
     
  7. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    fixed
     
  8. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    fixed
     
  9. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    That line, and the next, are indented a different amount than the preceding lines.
     
  10. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    One space off?? WOW that really means alot then huh?
     
  11. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    OK now i get this error:

    Traceback (most recent call last):
    File "BugEventManager", line 363, in _handleDefaultEvent
    File "StarSigns", line 141, in onUnitBuilt
    NameError: global name 'pUnit' is not defined

    Spoiler :
    Code:
    		elif chance2 == 11:
    			pUnit.setHasPromotion(promSign12, true)
    			szIcon = "Art/Interface/Buttons/promotions/VIRGO.dds"
     
  12. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,321
    Gender:
    Male
    Location:
    Canberra, Australia
    on line 82 try changing
    Code:
    	unit = argsList[1]
    to
    Code:
    	pUnit = argsList[1]
    I've got appointments all of this morning and I'll soon be late so I could not test that this is the fix. As far as I can find there is no documentation for these functions that actually tell you what those parameters are. I think it may really be iUnit but then the naming conventions used in Python are not explicitly used by everyone and since they need to guess at the parameters passed all the time it is no wonder they are not followed.
     
  13. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    OK i am 1st going to try out the pUnit one, thx for your help. . . SO
     
  14. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    Spoiler :
    Code:
    
    
    @ DH: OK i tried the above should i try the other one, because i get this error now?(pUnit)

    Traceback (most recent call last):
    File "BugEventManager", line 363, in _handleDefaultEvent
    File "StarSigns", line 144, in onUnitBuilt
    NameError: global name 'pPlayer' is not defined

    Spoiler :
    Code:
    		elif chance2 == 11:
    			pUnit.setHasPromotion(promSign12, true)
    			szIcon = "Art/Interface/Buttons/promotions/VIRGO.dds"
    
    		[B][U]pPID = pPlayer.getID()[/U][/B]
    		iXa = pUnit.getX()
    		iYa = pUnit.getY()


    and if

    (iUnit) i get this error?

    Traceback (most recent call last):
    File "BugEventManager", line 363, in _handleDefaultEvent
    File "StarSigns", line 108, in onUnitBuilt
    NameError: global name 'pUnit' is not defined

    Spoiler :
    Code:
    if chance == 7:  ### Lucky 7 Lol -> so 1% chance of getting a "sign promotion" ###
    		signTrue = true
    		if chance2 == 0:
    			[B][U]pUnit.setHasPromotion(promSign1, true)[/U][/B]
    			szIcon = "Art/Interface/Buttons/promotions/AQUARIUS.dds"
     
  15. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,321
    Gender:
    Male
    Location:
    Canberra, Australia
    I've got this mostly working, I just cant get the promotion star sign to appear in the event bubble thingy. I have an appointment now but will package this up for you when I get back.

    edit Here it is.
     
  16. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    Should i change the module name to match the Config file "Star Signs"?
     
  17. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,321
    Gender:
    Male
    Location:
    Canberra, Australia
    The name in the init.xml points to the file in the config folder. The name inside the config file points to the name of the python file. They don't have to be the same. It probably reduces confusion if they are the same. So its is up to you what you do. It should work as is.
     
  18. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    Out of boredom while searching for ideas...
    Give you a little help on how to display button
    Spoiler :

    Code:
    ## 
    		if unit.getUnitCombatType() > -1:
    			lStar = ["COMBAT1", "COMBAT2", "COMBAT3"]
    			iChance = CyGame().getSorenRandNum(100, "Star Promotion")	## 1% for each Promotion
    			if iChance < len(lStar):
    				iStar = gc.getInfoTypeForString("PROMOTION_" + lStar[iChance])
    				unit.setHasPromotion(iStar, True)
    				StarInfo = gc.getPromotionInfo(iStar)
    				CyInterface().addMessage(unit.getOwner(),True,15,CyTranslator().getText("TXT_STAR_PROMOTION",(unit.getName(), StarInfo.getDescription(),)),'',0, StarInfo.getButton(),ColorTypes(11), unit.getX(), unit.getY(), True,True)
    ## 
    Code:
    <TEXT>
    	<Tag>TXT_STAR_PROMOTION</Tag>
    	<English>[COLOR_GREEN]%s1 has earned %s2 Promotion![COLOR_REVERT]</English>
    </TEXT>
    
    Works in both onUnitBuilt or onUnitCreated whichever you like.
    Just replace the combat promotions with your star ones.
     
  19. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN

    Great thx, I was just going to write DH on this, because it gave me the promotion but i wasn't even aware of it?? Plus he's away from his PC and hopefully enjoying life.

    \I will see if i can make the changes and see what happens, again thx so much.;)
     
  20. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,461
    Gender:
    Male
    Location:
    MN
    Sorry i cant figure out where that goes, i dont have anything like that in the python??
     

Share This Page