Customizable script request: alliances amongst factions

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
So I was hoping someone could script a way for there to be alliances between all the factions and cultures in my game.

A way to set an alliance to neutral, enemy, ally with another faction, and the player.

A way to determine status of war and peace based on some elements, such as stability of an area, available resources such as gold, and status of other faction with parent faction.

I'm hoping this can easily be done, and I don't really want to use the ingame variables, as it's hard keeping organized for me. If there could be some self variables.

Also, if someone wants to walk me through how to script it, that would be super awesome. Because I would like to learn how to script, so I can do it on my own if need be. I hate bothering people for things, really I do. the more I can stand on my own, the better. but hey, community is nice sometimes too.

Thanks in advance for any help.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Are you using VX or VX Ace? Because your profile says one thing, but you posted in the other one's forum. Need to be clear on this, as the scripts are not interchangeable.
 

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
VX Ace. I'm so sorry. I have a disability, and it's difficult for me to stay organized. sorry.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Request. Please be sure to post your threads in the correct forum next time. Thank you.


Also a few comments on your request itself:


1) If you want it as a new script, you need to give more info like what do the settings do and so on.


2) depending on the number of factions in your game, it would be easier to use variables - because it's always a guess whether or not a large script request gets fulfilled or not.


3) there are scripts for self-variables if you want to go that route. PK8's self data suite is probably the most versatile: http://forums.rpgmakerweb.com/index.php?/topic/42500-the-self-data-suite-support-thread/
 

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
Well I suppose the settings would allow you to create a field/array for the factions, and a section that is when # to be able to set each faction to a possibility. something like a random chance for diplomacy to happen, based on gold the faction has, and how vulnerable a faction is/becomes. I guess there should be a favor rating for all factions, that is, a rating for how much a diplomacy is favored by the faction. 

it seems like this particular script would have function in future scripts for the project, so maybe I should wait until a scripter joins the team?
 

 Nova

Veteran
Veteran
Joined
Feb 8, 2015
Messages
163
Reaction score
136
I would really recommend eventing this, as it seems more than doable, as long as you think creatively :)
 

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
I was expecting there to be a need to use eventing for the script calls. but I was also really hoping it could be done with a customizable script, so others would be able to use it for their games. It would be cool if I could find a mentor for scripting.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
I think it's time to clear a few misconceptions that you appearantly have about what eventing and scripting is in the RM community.


Scripting is changing the engine by programming, either in Ruby (XP/VX/Ace) or in Javascript (MV). If you're talking about learning how to script in RM, then you're talking about learning how to program. That is not something that can be done fast unless you already have programming knowledge (for example in C/C++ or similiar programming languages.


You have to use scripts for menu changes, for changing the way the skills or the battles happen and similiar things.


Eventing is using the limited set of event commands to create ingame processes like quests or game effects like time, hunger, or more.


It is a lot easier to use than scripts, and a lot more secure as well - you can't destroy the engine with events, but you can cause a lot of problems with scripts.


Your Idea/Request is borderline between both - it does not need a script, because it doesn't change parts of the engine. However, it adds to the engine and some parts might be reusable or better as scripts than as events.


But in order to make it into a script, it needs a lot more definition - what is a "faction" (not as a name or country, but as a data object), what are the effects of alliances or wars or whatever etc.


Those strict definitions are needed to even enable it as a script - programming requires exact definitions and declarations.


And that is another reason why the event approach was suggested: You don't have to be as strict with events as with scripts, and it's easier to add the affects later into the structure.
 

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
well I have a background in binary, and QBasic, which can have similar functions. I think Ace has that ability as well.

So a faction is a string in an array. right away there is no need for descriptions of the factions, as that can be done later.

A status is a binary, 0, or 1. so a status of a faction, would be like war = nil, or neutral = 1, and for peace war = nil means peace,. there should be a XOR relation between the two statuses, that is checked by the variable status as a string.

eventually I want to add to the interface, a way to call an interactive window with a key or by selecting the proper menu item when pressing esc. this would allow for discovered territories statuses to be viewed. and also, allow the player to select if to message about status changes for a faction, or more specific to a faction-to-faction basis. but again, I think that can be implemented later, unless suggested otherwise.

A vulnerability is a percentage, or decimal of two digits, from .01 to 1, where 0 is a defeated faction. and the status of that faction no longer applies. The vulnerability is used in determining likelihood of being invaded. so to check if there is a war, every week in game time, there is a random chance of being invaded that I think would look like 1 / 1 - 1 where 0 is not possible for war, unless a war=1 with another faction the parent faction is allied with. in a sense, supporting their allies.

If war = nil and neutral = 1 then the result display should be peace.

I think that is my ideas on what the variables would do. please let me know if there is anything I need to do to correct anything, such as faulty logic.

thank you for helping.
 

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
I thought about what I had said a lot. I was worried I had made a mistake in my logic.

To clarify a few things:

if war = nil and neutral = nil, then the XOR relationship will result in a nil, and should be a status of neutrality. if war = 1 and neutral = 1, where the default of neutral is peace, then the resulting XOR relationship results in a nil and would also be a status of neutrality. I think I could go even further to use the two states resulting in nil to more thuroughly define the two options as eiether hostile, or friendly, as an attitude that is a string.

I think that faction should still be an array. but to develop it further, I am stuck on how to handle a status for all factions with a single parent faction. I think I can use another array for parent_faction and use it as an empty array, and use something like when 1 to define the status with another faction, or faction.status? I don't know for certain.

I have tried programming in ruby before, and did not get very far with it, figured out how to make arrays, but never much else.
 

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
So to answer more of your response, I would like to define what an alliance would do, and what a war would do, and what neutrality means in the game.

So without mimicking the political system of any of the Total War series, I will stick to some basic principles of diplomacy.

So an alliance, is determined as a war=nil state, and means that the parent faction supports the child faction in times of war. for the mean time, if a parent faction is allied with another faction that goes to war with a child faction, then there is a random chance for supporting either side, but only one side. again the support of either side should have an XOR relation to the other faction and child faction.

War, causes an even to be activated, such as the placement of soldiers on the maps, respective to some key locations. the first location is the nearest border. there is a time limit for the player to be able to help either side, and the ability to help is determined by the status of the player with the respective faction, and can change the status with the player to the defending side in the player assisted conflict (negating the theory of invader, as that is neutral in this matter). If the player does not assist either side in the allotted time, or assists and the time runs out before a resolution is met, then it is a random chance for either side to win by default, or there should be an ability to weigh what assets the soldiers have to their disposal to determine the result on a weighted random happening. the second location is the nearest city. if there is a wall around the city, then it happens outside, and is the a siege of the city. if there is no wall, it is an all out attack on the defending army of that city. if all soldiers have expired on the defending side, the city is surrendered and the invading faction claims it as a territory, with no change to architecture, but a change in what the NPCs say. if all soldiers of any side of the conflict are expired, the victory goes to the last man standing, so if the defender wins, there is no further conflict, the vulnerability rating of the defending faction increase positively, and the invader loses vulnerability rating, and the status between all nations involved is reset.

neutrality is the safest way to avoid conflict with anyone, as it does not weigh the faction in favor of any conflict.

the more we develop the game, the more we realize we will need even more scripts for the features we wish to include.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
Try not to double, or triple posts in this case.

You can always edit your older post to add in new information when no one else has post a new post after yours.

Please check the posting rules of the forum before getting yourself into trouble.

As for what you want is still not clear, from what i gathered, you are not looking for a multi-party(faction) battle script. So your battle still based on the default one party vs one party style. If that's the case, you don't really need a script to do what you want.

Simply have a variable, or a few variables, and even switches up to check if the factions are in good relationship or not with the player. Then set up your battle events to check for those variables before deciding to enter a battle or not. All do-able by eventing alone. Same goes to NPC shops and such, you can always do a check before deciding whether or not to open the shop UI in the event.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Why not trying something like:

Variable1 = 0 means Peace

Variable1 = 1 means Neutral

Variable1 = 2 means War

Now you just need to Adjust this Variable to change the state.

But you will need 1 Variables for every Faction. Than Factions needs Variables for every Faction.

Your number count in variables is going up ^^ 10Factions +1Player would mean around 100Variables just for the

Value how they like each other.

Now the hard works beginns and you need to make conditional branches so you can determine the different outcomes.

Than you need to merge this System with your other Stuff.

This sounds like a complex System.

You should make a better plan whats going on ingame when you push this or that button. tell how this stuff ingame looks and is used.

the stuff about arrays and so on doesnt help much in this case i asume.
 

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
ok.

when the player goes to the esc menu, there should be an option at the bottom of the selectable list for Diplomacy. Where the player can select and view any faction that has been discovered by the player. It should bring up a list of relations with other factions that have been discovered, and the status with the player. In the case that cities exist for that faction, there should be a vulnerability rating listed below the relations and status. this menu item can be accessed also by pressing d.

I use 53 factions for the game. but there still needs to be a random chance for diplomacy to change, every week in game time, based on the faction's vulnerability rating. where low vulnerability rating is more likely for change, and high vulnerability is less likely.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Ok that makes more than 2000 Variables.

Ok you realy need a Script or mega advanced eventing scriptcomand hybrid.

This is big. Sorry cant help with such advanced stuff. And i dont understand much not fully.
 
Last edited by a moderator:

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
well, if it helps, I'm using a questlog from TIdloc, and a Variable Calender/Weather system from Selchar. so some of the variables and functionality necessary for the script is in place.

I do appreciate your consideration to help. I'm really having a difficult time coming up with a structure for the script.

I spoke about arrays, because it seems like you could do a script command when 1, and then have variables underneath, for default settings. where when 1 is the assignment of first array element for a faction. but I really don't know enough about Ruby. I did do a search to see if such a script exists, and I could really use it for the style of game I and my team are creating.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
I know goes little off topic but iam little curious :)

Do you have a Worldmap to show as reference, where is the Action taking place

as changing events in the normal rpg maps, for example i travel east from cityA and for example at the gates map casue of variables stuff, enemie knights invading,

and you have to do stuff for example.Or is it fought on the Worldmap? Or is such stuff not needed with worldmap? Or do you use extra battle map picture and worldmap in standard way?

Your Group could maybe sneak to ocupied towns and do limited stuff in those cities. or traveling to friendly citie unlocks quests there, and maybe also miitary quests, where you help atacking other cities or stuff like that.

But would the player have its own faction or would he be something else?

Is there a red story line in that game, or is it more like sandbox with many shorter stories?

Can a Faction totally be defeated? even from other npc?
 
Last edited by a moderator:

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
so to help organize the team, I started a blog where information can be found. there is a world map we use for reference when making maps for the game, as well as city placement. http://forums.rpgmakerweb.com/index.php?/blog/174/entry-759-classical-age-world/

the nationality quests are the main storyline, and are optional. probably, because of the types of quests, I will have to make a new questlog script, for organizing the different types of quests storylines.

I think for the implementation of the wars, there will be an icon of two swords, and when the player activates the event of the two swords, you go to smaller map where the battlers are. they are simulating fight already, by lowering another's health until timer runs out, and a winner is determined.

A faction can be totally defeated. but I think for the last installment version of the game, there may be a way for revolts to happen, but that seems really difficult to implement, and would require hundreds of hours to make work properly. probably more historical eventing for revolts, or time based revolts.

edit: so i spent some time reading the contents under the help file in the creator, specifically arrays. it's confusing to me as not enough information is provided in the help files, like why it gives a result the way it does, or why adding a dot to a wor changes the functionality of the command. but from what I can gather, is that to make the faction array, I simply do 

Array.new(53) #in this case 53 for the total number of factions# {|i| i}

which would allow me to set each name of the faction.

and for status I would need 53*52, which is 6+10+0+250 = 265 + 53 #for the player# = 318

so I would do

Array.new(318) {|i| i}

but where I get lost, is how to use a variable in place of i or even how to add another value to the array,but I think if I assign the following

status = Array.new(318, "status")
and then 
assign the vaules corresponding to the states of diplomacy, such as war and peace.
however I am uncertain if I can do faction.status for instance.
so I assume that I can simply do

Array.new(318) {|i| i |i|}
where the first value is the faction number, and the second value is the status, and the third value is the child faction.
and set status = Array.new(318, "status", faction.child)

please provide me information on if this is the correct thinking for handling this.
 
Last edited by a moderator:

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
Array is already built-in to the rgss3 script. So you don't need to call for it to use it.

Simply do a script call like

A = ["apple", 2, -0.6]

and you get

A[0] = "apple"

A[1] = 2

A[2] = -0.6

And if you want those to be save-able with the game save files. Use the in-game variables for it.

Here's a good example on how to work arrays using the in-game variables inside rgss3.
 

chungsie

Veteran
Veteran
Joined
Sep 9, 2015
Messages
656
Reaction score
857
First Language
English
Primarily Uses
N/A
how would I go about showing a value saved in an array as a variable in a menu? say for instance, I want to be able to go to menu in game, and have option to view status of factions. how would I go about doing that? also I need for the ability to show an image next to the faction name in the menu window when selected status of factions.

also, thank you, that information really helped.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,546
Members
137,835
Latest member
yetisteven
Top