Announcement

Collapse
No announcement yet.

Scenario Events and stuff

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

  • Scenario Events and stuff

    Can someone answer a few questions, mostly slic related...

    1. How do i stop all players from using ANY diplomacy at all with each other via slic? Including stopping the human from initiating diplomacy.

    2. If a named unit is killed, how do i make a popup? Like for example if the "HMS Repulse is sunk by the Japanese", when the Japanese attack and sink that particular named unit? It will be a generic unit though (ie unit_battlecruiser) or would i need to create a special unit_hmsrepulse? (that seems overly complicated though for one unti) but it will be killed at game start anyway so...

    3. How do i spawn units on a given turn, and the make them attack a specific city or tile in the next turn/s?

    I think i could probably dig some of these answers from the Alexander scenario etc eventually but it never works when i try to hack pieces from it.

    Okay ive got plenty more questions, but these will do for now.
    Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
    CtP2 AE Wiki & Modding Reference
    One way to compile the CtP2 Source Code.

  • #2
    Re: Scenario Events and stuff

    Originally posted by Maquiladora
    Can someone answer a few questions, mostly slic related...
    1. How do i stop all players from using ANY diplomacy at all with each other via slic? Including stopping the human from initiating diplomacy.
    You don't need SLIC, just go into diplomacyproposal.txt and add
    Disabled
    to all of the proposals you want to turn off



    Originally posted by Maquiladora
    2. If a named unit is killed, how do i make a popup? Like for example if the "HMS Repulse is sunk by the Japanese", when the Japanese attack and sink that particular named unit? It will be a generic unit though (ie unit_battlecruiser) or would i need to create a special unit_hmsrepulse? (that seems overly complicated though for one unti) but it will be killed at game start anyway so...
    I'm guessing that you will have to create a new unit and then create a SLIC trigger for the actual event (Ben says that it is easy to do, and I'm hoping to see it pulled off in War of the Ring), but if all you need is a message at the beginning of the game, I hijacked Dale's Diplomod messagebox (diplomod_str.txt) and used it for my own beginning game message. You need to be using Diplomod though.



    Originally posted by Maquiladora
    3. How do i spawn units on a given turn, and the make them attack a specific city or tile in the next turn/s?
    Another thing that I would like to see in War of the Ring, so I'm hoping the SLICers can pull some magic out of their hats...
    Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
    ...aisdhieort...dticcok...

    Comment


    • #3
      Re: Scenario Events and stuff

      Originally posted by Maquiladora
      2. If a named unit is killed, how do i make a popup? Like for example if the "HMS Repulse is sunk by the Japanese", when the Japanese attack and sink that particular named unit? It will be a generic unit though (ie unit_battlecruiser) or would i need to create a special unit_hmsrepulse? (that seems overly complicated though for one unti) but it will be killed at game start anyway so...
      If you can guarantee it's location at the beginning of the game, then you don't need to define a new unit. If you cannot, then by far the easiest way is to have a UNIT_HMS_REPULSE.

      Then you need something like this:
      Code:
      HandleEvent(BattleAftermath) 'is_hms_repulse_still_around' pre {
           int_t i;
           unit_t tmpUnit;
           int_t here;
           // assuming REPULSE owner is 1
           for(i=0; i < PlayerUnitCount(1); i = i + 1){
               GetUnitByIndex(1, i, tmpUnit);
               if(tmpUnit.type == UnitDB(UNIT_HMS_REPULSE)){
                   here = 1;
               }
           }
           if(!here){
                message(1, 'hmsrepulse_dead');
          }
      }
      
      messagebox 'hmsrepulse_dead' {
      Show();
      Title(ID_HMS_REPULSE_DEAD_TITLE);
      Text(ID_HMS_REPULSE_DEAD);
      }
      3. How do i spawn units on a given turn, and the make them attack a specific city or tile in the next turn/s?

      Without going in to too much detail, you'll need to know the locations they'll be spawned in, do CreateUnit functions for each one (as used in the AtG scen), then store each one, probably best to use a unit array. Then on the next beginturn for their owner, check they're still alive, and use a MoveOrder or Battle order perhaps to force the attack. I don't know if this works properly.
      Try looking at Peter Triggs reSLICed WW2 scenario. This might have examples of this kind of thing.
      Concrete, Abstract, or Squoingy?
      "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

      Comment


      • #4
        1.
        Code:
        HandleEvent(NewProposal) 'StopAllProposals' pre {
        	return STOP;
        }
        Even if the human sends a proposal the diplo screen will close and nothing happens.
        "Kill a man and you are a murder.
        Kill thousands and you are a conquer.
        Kill all and you are a God!"
        -Jean Rostand

        Comment


        • #5
          Thanks to all Thats got a few out of the way.

          Im gonna work a little on my own slic writing while i work on the cosmetics of my scenario so i wont be asking anymore just yet.

          By the way, what does cityid.txt do exactly? Been staring at it for the past 2 hours and i still dunno. It wasnt modifed for citymod2 though, so im guessing its defunct or i just wont need to change it.
          Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
          CtP2 AE Wiki & Modding Reference
          One way to compile the CtP2 Source Code.

          Comment


          • #6
            3. Can be done with a variation of the frenzy AI. :

            And use three events in a beginTurn handler:
            CreateUnit
            MovePathOrder (to be close to the city, doenst work properly to move one tile)
            MoveOrder (to move inside the city)

            "Kill a man and you are a murder.
            Kill thousands and you are a conquer.
            Kill all and you are a God!"
            -Jean Rostand

            Comment


            • #7
              what does cityid.txt do exactly?
              Nothing. CTP1 Left over.
              "Kill a man and you are a murder.
              Kill thousands and you are a conquer.
              Kill all and you are a God!"
              -Jean Rostand

              Comment


              • #8
                Ah okay, good.

                One more question, if i create an event for say: if the human player attacks the Neutral Civ they get all gold taken away for 10 turns. But make it so the human can still pay upkeep+wages, but limit them to no rush buying money, perhaps change the gold amount to 100 after the turn has been played ready for next turn. Also i want to prevent the AI from attacking the Neutral Civ, civ number 7.
                Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                CtP2 AE Wiki & Modding Reference
                One way to compile the CtP2 Source Code.

                Comment


                • #9
                  The new Question: UNTESTED and May Contain Syntax errors

                  Code:
                  int_t PlayerRemovedGold[];
                  
                  HandleEvent(BattleAftermath) 'BlaBlaBlabyPedrunn' pre {
                  int_t tmpGold;
                  	if(IsHumanPlayer(player[0])) { 
                  		if (GetEffectiveRegard(player[0], Player[1]) > 300) {
                  			PlayerRemovedGold[player[0]] = PlayerGold(player[0]);
                  			AddGold(player[0], -PlayerRemovedGold[player[0]]); 
                  		}
                  	}
                  }
                  
                  HandleEvent(EndTurn) 'BlaBlaBla2byPedrunn' pre {
                  	if(PlayerRemovedGold[player[0]] != 0) {
                  		AddGold(player[0], PlayerRemovedGold[player[0]]);
                  		PlayerRemovedGold[player[0]]= 0;
                  	}
                  }
                  I gotta adimit i dont like this idea at all .
                  Last edited by Pedrunn; December 9, 2002, 19:19.
                  "Kill a man and you are a murder.
                  Kill thousands and you are a conquer.
                  Kill all and you are a God!"
                  -Jean Rostand

                  Comment


                  • #10
                    Dont worry im saving all these

                    Yeah im not sure about that either, but i dont want to completely stop the player from not being able to attack the neutrals, but i also want to give the human a penalty if they choose to attack at some point, ill see.

                    Im planning plenty of events, mostly attack/message popup related, but this would provide the human with a good strategic choice too.
                    Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                    CtP2 AE Wiki & Modding Reference
                    One way to compile the CtP2 Source Code.

                    Comment


                    • #11
                      if i create an event for say: if the human player attacks the Neutral Civ they get all gold taken away for 10 turns.
                      The code removes all the gold from the human player if they attack a nutral civ only for one turn. And thats all it does
                      Last edited by Pedrunn; December 9, 2002, 22:08.
                      "Kill a man and you are a murder.
                      Kill thousands and you are a conquer.
                      Kill all and you are a God!"
                      -Jean Rostand

                      Comment


                      • #12
                        Yeah i read that part right then. I guess thats not as bad, but as the human will know the consequences for attacking a neutral nation, they could spend all their money before they attack so it doesnt get taken away.
                        Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                        CtP2 AE Wiki & Modding Reference
                        One way to compile the CtP2 Source Code.

                        Comment


                        • #13
                          er... is the only other use for gold rush-buying? It would be much easier to prevent that, rather than messing with the amount of gold they actually have.
                          Concrete, Abstract, or Squoingy?
                          "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

                          Comment


                          • #14
                            cross posted abit there

                            Originally posted by Immortal Wombat
                            er... is the only other use for gold rush-buying? It would be much easier to prevent that, rather than messing with the amount of gold they actually have.
                            Yeah, i just dont want the human to have the ability to rush buy units if they want to gain an advantage by attacking a neutral. But i think taking away their money for several turns and giving a popup telling them, has more atmosphere, no?
                            Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                            CtP2 AE Wiki & Modding Reference
                            One way to compile the CtP2 Source Code.

                            Comment


                            • #15
                              Or,

                              If say, Britain attacks a Neutral city, Germany and Japan receive 5000 gold each, sort of like the Neutrals paying for help but no need to deduct the Neutrals money because theyll be unplayable and no one will notice.
                              Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                              CtP2 AE Wiki & Modding Reference
                              One way to compile the CtP2 Source Code.

                              Comment

                              Working...
                              X