## Treaty: Choose your way to peace

Show off your games, demos and other (playable) creations.
Gunroar:Cannon()
Party member
Posts: 344
Joined: Thu Dec 10, 2020 1:57 am

### Treaty: Choose your way to peace

Treaty
treaty.love
In the universe of beans a universal war is about to break lose, but one problem, Earth is
really behind in technology compared to most of the other aliens. You, as the president of
Earth has to get the aliens to sign a peace treaty to leave Earth out of the war.

Treaty is a text game I had the idea of a long while ago(like 2 years ago), and I made this little project since I'm not really serious with the whole idea. You just make choices(4 at max) to get
the planet's leader you're talking to to agree to sign a war treaty, if they disagree Earth
automatically gets blown up due to it not lasting long in the war.

The game has 5 levels now,at time of writing,(I made it in the last 2 days). Levels are split into "packs".

The two packs I have are "beans"(yes, beans. It's a universe) and a love2d related one called
lövely_war, that features 3 special guests. I wanted to add more but it takes time to make
a level(around one hour, not so long, but I don't have alot of time), and I can

If you want me to make a level for you, you can say, and can also give details to what you want.
On the other hand, if you find this offensive to you, I can change your level a bit, or ... or...

You can make your own levels too.

(A) STRUCTURE

--|*name of pack*
-----|images
-----|sounds
-----|levels
-----|music

1) Make a folder(directory) and give it the name of your pack

2) In that folder have 4 sub folders(empty or not):
images : stores all image references(any type supported by love2d),
sounds : stores all sounds(like voices),(ogg, wav, mid, or mp3),
levels: stores the json like .lua files that contain levels(ogg, wav, mid, or mp3)
music: contains music used for a game
All sources are universal across all projects, so try to name your files specially to avoid
overwritten data.
Sound/music files actually support anything supported by love2d that has 3 letters after the dot
(like .ogg and .wav)

(B) Levels
1) All levels are stored in a lua file in the levels directory of your pack.

2) All levels must return a table. This table will have the choices, configuration and speech
for the level.

3) A level file should have these configuration values:
(cumpulsory) String name: official name of the level/alien being talked to,
(compulsory) String source: name of picture used as potrait for level/alien, should have extension(eg. ".png"),
(cumpulsory) String description: description of level,
(preferred) Number textSpeed: how fast alien's text is typed, defaults to 0.05, the bigger the number the slower
(preferred) String textSound: name of sound used for alien talk, no extension("ba", not "bah.wav"),
(optional) String music: music used for level
(optional) Number musicVolume: volume of music, defaults to 0.5
(never use) Table parent refers to the pack thisnlevel returns to, leave empty, will be overwrittem

example:

Code: Select all

return {
name = "Bambooz the Bamboozler",
source = "bambooz.png",
textSpeed = 0.05,
textSound = "bah",
music = "tmp",
musicVolume = .2,
description = [[Bambooz is the leader of the Bamboozles that are all like those stingy rich business men
in fancy toilets... that's normal, right?]],
....
}

4) For level structure dialogues are a table with a name, the first dialogue must be called "p1".
dialog structure:

Code: Select all

    p1 =  {
text = what alien says this at this point,
option1, option2
}
Options are string arrays(?) that are ipaired(?) into the dialogue table with the structure:

Code: Select all

    {name of dialogue it leads to, option text}
You can have 4 options max.

To make a dialog the losing dialog, put no options and then put a variable in the
dialog BOOM and make it true, reversely you put SIGNED = true to make a winning scenario.

So now we could have something like:

Code: Select all

return {
....,
p1 = {
},
p2 = {
text = "So you are an adventurer, well now die...",
BOOM = true,
},
p3 = {
text = "I see you have guts to stand up for your name, I'll sign!",
SIGNED = true
}
}
...

gameDescription into the level(maybe under description, I don't know).

All in all it's pretty easy, especially if you're familiar with lua.

(C) Using pack
1) Copy and paste the pack into
i) A folder called gamedata(you can make that one too) into the external storage path for save data in löve,
(com.hmmmgameslite.treaty) or...
ii) The folder gamedata inside the treaty lovefile/folder(the same place main.lua is).

2) Run the game and you should see your pack there, hoorah, now you can get big and blow up(what, a dolphin?).

(D) Tips for writing levels
-It might be easy to code it, but maybe it gets complicated to write it so here's the method I use:

1) Type the first dialogue and all options for that dialogue, but only give one option the name of the dialogue it leads to.

2) Move to type out that dialogue and do the same thing as before(i.e. only give the first option the name of the dialogue it leads to.)

3) Repeat these steps until you get to an end condition(winning or losing), then go back to the start and find the option that doesn't
have the name of the dialogue it leads to.

4) Type the dialogue for that option and give it the dialogue's name.

5) Rinse and repeat until no more options have empty dialogue names.

You could also write it down on paper in a tree style structure and then type it, and then get big and blow up(que "what, a dolphin?").

(!) WATCH OUT FOR TYPOS.

If you have any suggestions you can say, if you have problems be free to spree, typos? All for corrections here. Levels can post them if you made any. Slander, sure. If you want to keep quiet do so, do what you want with it yadda yadda
...
...
but then blow up, it's kind of cumpulsory...
Screenshot
Screenshot_2021-05-09-10-45-21.png (355.66 KiB) Viewed 3859 times
treaty.love
treaty.love
The outdated file
Guests include pgimeno, zork and slime -_-
Last edited by Gunroar:Cannon() on Thu Jun 17, 2021 6:01 am, edited 4 times in total.
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved
Gunroar:Cannon()
Party member
Posts: 344
Joined: Thu Dec 10, 2020 1:57 am

### Re: Treaty: Choose your way to peace

Ermm...oh yeah! I added speech using a feature from Talkies.lua that changes the pitch. The alien generals sound like they have their own language

Works on windows and android, not sure about mac.
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved
Gunroar:Cannon()
Party member
Posts: 344
Joined: Thu Dec 10, 2020 1:57 am

### Re: Treaty: Choose your way to peace

If anyone...has any ...feedback......does it error...or ....?
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved
Gunroar:Cannon()
Party member
Posts: 344
Joined: Thu Dec 10, 2020 1:57 am

### Re: Treaty: Choose your way to peace

I added an update to lövely_war with the new character 4vZEROv.
Just unzip the folder and include the pack again(make sure ti delete the old one , or you could rename the folder for it to appear as a new pack )

If you include this update you can also change what the president is thinking(that "I want to play super mario" or "Oh, mama's biscuits" at the top) by adding into a dialog thought = "Put your text here".
Attachments
lövely_war.zip
Last edited by Gunroar:Cannon() on Thu Jun 17, 2021 6:16 am, edited 1 time in total.
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved
Gunroar:Cannon()
Party member
Posts: 344
Joined: Thu Dec 10, 2020 1:57 am

### Re: Treaty: Choose your way to peace

Updated treaty! Fixed some typos, and some bugs. Still typos and bugs though, I'm sure of it.

New Stuff in Editing
-In an option you can put instant=true for the player to lose immediately after tapping that option.
-In a dialog you can put loseText="..." to change what the game says when the player loses.
-In a dialog you can put narrator=true, to change it to a narrator talking.
-For people/levels you can put talkSounds = {"wooh","huh",...} , a list of sources to randomize when character is talking.

New Level in beans: Hinatah the Samurai
Attachments
Hinatah
tmp-cam--887405619.jpg (12.57 KiB) Viewed 318 times
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved

### Who is online

Users browsing this forum: No registered users and 18 guests