Announcement

Collapse
No announcement yet.

CREATUNIT question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CREATUNIT question

    Have others had trouble spawning units in squares "controlled" by another civ; ie. a square where a unit of another civ was last to occupy, but which is vacant at the time of the attempt to spawn a unit there?

    Is there some hex value in the sav. file that tracks this?

    I'm trying to re-work the Kronstad Revolt event for Red October. The Kronstadt unit is an immobile naval fort unit, controlled by the Bolsheviks. It's on ocean terrain, and blocks Entente naval units from bombarding Petrograd. Late in the game, the sailors revolt, and the unit changes to Anarchist (barbarian) control. The Reds then have one turn to destroy it, before the British fleet arrives to attack Petrograd.

    So far, I've been able to switch the unit to the barbarians using a CHANGETERRAIN event to eliminate the Bolshevik unit, and adding a new, barbarian one. But when the Reds (or the Entente) succussfully destroy that, I can't seem to repeat the trick and recreate a Bolshevik (or Entente) Kronstadt.

    Can anyone help?
    Tecumseh's Village, Home of Fine Civilization Scenarios

    www.tecumseh.150m.com

  • #2
    I know this is completely out of the blue, but have you tried deleting all units at the square with Kronshtadt? I am talking about "delete all units at X,X" command.

    Comment


    • #3
      Just thinking out loud...

      Have you tried triggering a ChangeTerrain event in 33,21 when the Barbarian unit is killed? This may reset the ownership of the square (if that is needed).

      Any chance this is linked to TRIGGERATTACKER or ANYBODY wildcards instead? Would specifying Bolsheviks and Anarchists work any better?
      El Aurens v2 Beta!

      Comment


      • #4
        I did Gelion, before I saved the scenario. The problem is that there are units of at least 2 civs that occupy the same square in sequence.

        Boco, the problem is the 'order of execution' of events, listed at the end of the section in the manual. 'CreateUnit' comes ahead of 'ChangeTerrain', so a newly created unit is immediately wiped out by the terrain change. Without the terrain change, the unit doesn't appear. Catch 22!

        I solved this in the first set (changing Kronstad to barbarian from Bolshevik) by using a 'Givetech' event when the unit is killed and then using a 'Receivedtech' trigger for the 'Createunit' event. Since 'ChangeTerrain' comes ahead of 'GiveTech', the new unit is spawned AFTER the 'ChangeTerrain' occurs.

        I've tried the same thing, but is doesn't work the second time. Here are the two key events:

        @IF
        UNITKILLED
        unit=Kronstadt
        attacker=ANYBODY
        defender=Barbarians
        @THEN
        CHANGETERRAIN
        terraintype=10
        maprect
        34,20,34,20,34,20,34,20
        GIVETECHNOLOGY
        receiver=TRIGGERATTACKER
        technology=26
        @ENDIF


        @IF
        RECEIVEDTECHNOLOGY
        receiver=ANYBODY
        technology=26
        @THEN
        CREATEUNIT
        unit=Kronstadt
        owner=TRIGGERRECEIVER
        veteran=no
        homecity=none
        locations
        34,20
        endlocations
        JUSTONCE
        @ENDIF

        The first event works- the terrain changes, and the tech is given.

        The second one also works, if I shift the place the unit is to appear to another square controlled by the Bolshies, such as Petrograd. It's a valid event, the unit just won't appear where I want it.
        Last edited by techumseh; January 2, 2008, 23:35.
        Tecumseh's Village, Home of Fine Civilization Scenarios

        www.tecumseh.150m.com

        Comment


        • #5
          Hmm.... it could be due to the fact that the AI thinks that this square is occupied this turn....

          Comment


          • #6
            Originally posted by techumseh
            Boco, the problem is the 'order of execution' of events, listed at the end of the section in the manual. 'CreateUnit' comes ahead of 'ChangeTerrain', so a newly created unit is immediately wiped out by the terrain change. Without the terrain change, the unit doesn't appear. Catch 22!
            The order of execution only applies to actions within the same event. Since you're now using two events anyway, you might just as well do two events like this instead:

            Code:
            @IF
            UnitKilled
            blah
            @THEN
            ChangeTerrain
            blah
            @ENDIF
            
            @IF
            UnitKilled
            that same unit
            @THEN
            CreateUnit
            blah
            @ENDIF
            That'll save you from having to use up a technology.
            Not sure if that solves the problem, though.

            What happens if you add the CreateUnit action to both events? The first unit will get destroyed by the ChangeTerrain, but its creation might be enough to reset the square's owner or something so that the second unit can be created successfully.
            Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

            Comment


            • #7
              Interesting. I'll give it a try. Thanks.
              Tecumseh's Village, Home of Fine Civilization Scenarios

              www.tecumseh.150m.com

              Comment


              • #8
                Did it work? (I suppose not)
                Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                Comment

                Working...
                X