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

Assistance needed for changing starting units

Discussion in 'Rhye's and Fall Modmods' started by Crossphazer, Oct 18, 2010.

  1. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    As the thread title suggests, I'm trying to change the starting units of spawning civs in my Scenario+modmod because I've drastically increased the number of independent cities in Europe, but I have no idea how to do so without breaking the game. I've tried changing some numbers in RiseAndFall.py, but all it gives me is the "You Have Been Defeated!" screen on start.

    I'm working with RFC: epic/marathon and using PyScenario if it makes any difference.
     
  2. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,093
    Gender:
    Male
    Location:
    Leblanc
    You're right to make your changes in RiseAndFall.py.

    I guess the problem is that you've made some minor syntactic error in the code which results in the Python file not being properly loaded (and thus spawns etc. not happening). From here it's difficult to find out what went wrong, but as a first guess, did you mind indentations?

    I generally suggest to enable Python exceptions by setting the respective entry in _Civ4Config from 1 to 0 (look for hide python exceptions). Then the game will show you the line of code that caused your problem.
     
  3. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    Thanks for the tip! I'll try enabling Python exceptions and see where I messed up. I really don't know what went wrong, as all I did was replace a number with another (e.g. 3 instead of 2, etc.)

    EDIT: Hmm, everything works now. Shame, because I had lost about 10 hours of work when I tried to reinstall RFC: epic/marathon to get the original files back (I had put my modded folder in another directory but somehow it got overridden :( )
     
  4. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    Sorry for double post, but I have another question: Is it possible to make post 600 AD civs playable in the 600 AD scenario? I've converted Carthage into Al-Andalus and Greece into Bulgaria, but I have no idea how to make them playable. I've tried tIsActiveOnLateStart 0/1 in Consts.py, but it appears to have done nothing.
     
  5. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Spawn dates are hard-coded in the SDK, unfortunately. But you could "respawn" the Civ with PyScenario:
    Code:
    Trigger("spawn al-andalus").player(iCarthage).date(711).respawn(2,True)...
    Refer to the API for more details.
     
  6. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    Actually, I've already done exactly what you are talking about :p I was just wondering if it was possible to make it playable from the scenario as the human player.
     
  7. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Try enabling the Civ in the WBS:
    Code:
    BeginPlayer
    	LeaderType=LEADER_HANNIBAL
    	CivType=CIVILIZATION_CARTHAGE                 
    	Team=6                 
    	PlayableCiv=[B][COLOR="Red"]1[/COLOR][/B]                 
    	Handicap=HANDICAP_PRINCE                 
    EndPlayer
    Chances are that this will cause the mod not to load properly, even coupled with the change in Consts that you already tried. But you could try granting the Civ the starting units in the WBS also, because then it would be active from start anyway. :king: Unhistorical, I know, but so is Arabia in AD 600. :p
     
  8. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    Okay, so I got them to be selectable from menu, but I don't know how to grant starting units in the WBS... (right now it's instant "You have been defeated!")
     
  9. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Look at the Byzantine tile entries in the WBS - some of them contain pre-set units. Copy-paste those entries and change them into whatever it is you need. Other than that, the WB is covered in the Modiki, so there is no reason for you not to know how to work it. (It is the most basic form of scenario making, after all.)
     
  10. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    Ah woops! I just didn't see the units at first glance. I gave them a city and some units in the WBS, but I still somehow died.
     
  11. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Double-check your entires. You could start off easy with just one unit, or something. This would help you to figure out what is wrong.

    If all else fails, just post your WBS and we'll have a look at it.
     
  12. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Also, you could add those starting units with PyScenario - use the startup() Condition to modify the map before the game starts.
     
  13. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    This is what I added to the WBS:

    BeginPlot
    x=54,y=39
    isWOfRiver
    RiverNSDirection=0
    TerrainType=TERRAIN_PLAINS
    PlotType=1
    BeginUnit
    UnitType=UNIT_LONGBOWMAN, UnitOwner=6
    EndUnit
    BeginUnit
    UnitType=UNIT_LONGBOWMAN, UnitOwner=6
    EndUnit
    BeginUnit
    UnitType=UNIT_WORKER, UnitOwner=6
    EndUnit
    BeginCity
    CityOwner=6
    CityName=Al-Jaza'ir
    CityPopulation=2
    BuildingType=BUILDING_PALACE
    BuildingType=BUILDING_GRANARY
    BuildingType=BUILDING_HARBOR
    EndCity

    EndPlot

    EDIT: hmm, this doesn't seem to show indentation
     
  14. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,093
    Gender:
    Male
    Location:
    Leblanc
    Use the
    Code:
     tags to show indentations (it doesn't matter for WB files, though).
    
    On the matter of making pre 600 AD slots playable in 600 AD, I've seen it tried often, but never successfully. It seems to be rather difficult, so I suggest you try to use a workaround via triggered respawns like Baldyr's proposed PyScenario solution.
     
  15. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Yeah, I can't see anything awry with your WBS "code" either. The PyScenario option would be something like:
    Code:
    Trigger("al-andalus").player(iCarthage).startup(True).target(54,39).units(eType=iSettler)
     
  16. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    Sadly, I've tried the PyScenario trigger you've sent me as well as others I've tried, but none have prevented the defeat message, except one time where for some reason I spawned as a catapult in Antartica, then flipped Cadiz a few turns later due to another trigger I wrote.

    I have noticed something odd about it's spawn date though:
     
  17. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,093
    Gender:
    Male
    Location:
    Leblanc
    Are you completely sure that there's no syntax error in your changes to RiseAndFall.py? That would be the easiest explanation for the "you have been defeated" messages.

    It says BC because the Carthaginians spawn BC. If you want to change that, you have to edit the DLL, which you'll have to do anyway if you want to modify spawn dates.
     
  18. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Yeah, changing Civs requires a new DLL file. Because the spawn date, settler maps and whatnot are located in the SDK.

    Other than that, try starting over with a fresh set of files. An unedited RiseAndFall, Consts and WBS. Just to make sure you haven't made a mistake somewhere.
     
  19. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    I'll try that then. Thanks for all the help guys! :)
     
  20. KMRblue1027

    KMRblue1027 The Crown!

    Joined:
    Mar 4, 2010
    Messages:
    2,194
    Location:
    Hamilton, NJ
    Don't bother trying to edit the WBS. I tried with Rome for 600 A.D. and it completely backfired. Something Rhye did to the 600 A.D. games made it imposable to play classical civs. Your best bet is to use cheat mode. Spawn a unit of Carthage then switch to them. It will kill your guy and spawn a catapult in the antarctic. Then just worldbuild your settlers and units back and away you go.
     

Share This Page