Making a scenario using "Regicide" type of victory
- Loewenherz
- Posts: 244
- Joined: 23 Sep 2017, 17:26
- Has thanked: 7 times
- Been thanked: 21 times
Re: Making a scenario using "Regicide" type of victory
Can you share the scenario with us?
List of tutorials, useful threads and utilities (look here before posting): Here
Add Pics to Map: viewtopic.php?f=54&p=25184#p25184
Loews Work: viewtopic.php?f=54&t=5160
Add Pics to Map: viewtopic.php?f=54&p=25184#p25184
Loews Work: viewtopic.php?f=54&t=5160
Re: Making a scenario using "Regicide" type of victory
It's not yet ready I need to test it from A to Z first and also add some story, tips.
Here you can find all scenarios that I've already made (the latest 3 are mine):
http://ee.heavengames.com/downloads/lis ... =0&s=d&o=d
Also, I didn't make such awesome scripts before, so those scenarios are simple. The new one will be the best!
Here you can find all scenarios that I've already made (the latest 3 are mine):
http://ee.heavengames.com/downloads/lis ... =0&s=d&o=d
Also, I didn't make such awesome scripts before, so those scenarios are simple. The new one will be the best!
Re: Making a scenario using "Regicide" type of victory
So, as expected, the bug was found
Despite the fact that all of the players (except human player, of course) are now AI players, the error message is still here. How it could be that player 7 is not an AI player when all 2-8 players are AI players in Map Editor?
Despite the fact that all of the players (except human player, of course) are now AI players, the error message is still here. How it could be that player 7 is not an AI player when all 2-8 players are AI players in Map Editor?
- Attachments
-
- EE2_ScreenShot4.jpg (206.39 KiB) Viewed 1640 times
-
- Снимок.PNG (3.97 KiB) Viewed 1640 times
- Dr.MonaLisa
- High Representative
- Posts: 8708
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 108 times
Re: Making a scenario using "Regicide" type of victory
What is in KingDeadAction7? Could you paste it?
Did you Save the scenario before clicking on Test Mission?
Have you tried the solution from my previous post?: viewtopic.php?p=23981#p23981
Did you Save the scenario before clicking on Test Mission?
Have you tried the solution from my previous post?: viewtopic.php?p=23981#p23981
To prevent your previous error, there is a function called: IsPlayerHumanControlled().
So it could look like this to prevent debug message displaying:The " ! " before function name, means to execute it when it's FALSE.Code: Select all
if(!IsPlayerHumanControlled(US_ARMY)){ ForceSurrenderOffer(..., ...); }
So same effect as:Code: Select all
if(IsPlayerHumanControlled(US_ARMY)){ //do nothing } else { ForceSurrenderOffer(..., ...); }
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Re: Making a scenario using "Regicide" type of victory
I don't understand how to apply this solution. For example, I have this:
How should I change it to check human player?
Code: Select all
RULE ruleObj_Korean_Peninsula2 ONESHOT
if (!DoesUnitExist( "tx_King_Korean_1" )
)
then KingDeadAction2
END_RULE
ACTION KingDeadAction2
SCRIPT WORLD
ForceSurrenderOffer(2, 1);
END_SCRIPT
END_ACTION
- Dr.MonaLisa
- High Representative
- Posts: 8708
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 108 times
Re: Making a scenario using "Regicide" type of victory
As in the example:
Not sure if it should be 2 or 1 (I don't remember all functions syntax).
Code: Select all
RULE ruleObj_Korean_Peninsula2 ONESHOT
if (!DoesUnitExist( "tx_King_Korean_1" )
)
then KingDeadAction2
END_RULE
ACTION KingDeadAction2
SCRIPT WORLD
if(!IsPlayerHumanControlled(2)){
ForceSurrenderOffer(2, 1);
}
else {
//Other stuff to kill this player. CreateGroup, etc.
}
END_SCRIPT
END_ACTION
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Re: Making a scenario using "Regicide" type of victory
Hm, problem is still here. It's also strange that it appears not every time.
Here's my script:
Where Group_Korea_1 is the group created in Map Editor that includes all buildings and units of AI player North Korea 1;
and 2 is the number of North Korea 1 in script
Here's my script:
Code: Select all
RULE ruleObj_Korean_Peninsula2 ONESHOT
if (!DoesUnitExist( "tx_King_Korean_1" )
)
then KingDeadAction2
END_RULE
ACTION KingDeadAction2
SCRIPT WORLD
if(!IsPlayerHumanControlled(2)){
ForceSurrenderOffer(2, 1);
}
else {
CreateNamedGroup("Group_Korea_1");
AddUnitsByTypeToGroup("Group_Korea_1", "Everything", 2, kPlayerMode_Self, NULL);
AddUnitsByAttributeToGroup("Group_Korea_1", "Everything", 2, kPlayerMode_Self, NULL);
if(NumUnitsInGroup("Group_Korea_1") > 0){
SelectGroupForPlayer("Group_Korea_1", 2);
KillSelection();
ClearSelection();
}
}
END_SCRIPT
END_ACTION
and 2 is the number of North Korea 1 in script
- Attachments
-
- Снимок.PNG (4 KiB) Viewed 1634 times
- Dr.MonaLisa
- High Representative
- Posts: 8708
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 108 times
Re: Making a scenario using "Regicide" type of victory
And did you follow the SCRIPTING.doc?
Was AI Diplomacy Enabled in Initialization?// void ForceSurrenderOffer(int in_iPlayerAI, int in_iPlayerHuman)
// force the AI in_iPlayerAI to surrender to in_iPlayerHuman
// YOU HAVE TO ENABLE STRATEGIC LEVEL DIPLOMACY FOR THIS PLAYER, OR YOU
// WILL GET A WEIRD CRASH WITH A NON OBVIOUS ERROR MESSAGE:
// DO THIS FIRST: SetAIDiplomacyEnabled()
ForceSurrenderOffer(2, 1);
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Re: Making a scenario using "Regicide" type of victory
Nope, I thought
SetAIDiplomacyEnabled(true);
would change Diplomacy conditions
SetAIDiplomacyEnabled(true);
would change Diplomacy conditions