Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

Môsi

A tiny game editor you can use on your phone or in your browser · By sg

Advanced Scripts

A topic by alexsilent created Oct 30, 2019 Views: 248 Replies: 15
Viewing posts 1 to 3
(3 edits)

I trying to make some advanced scripts in my little game and got some problems.

1) Is there a way to write ELSE dialogue? 

{if {eq {item-count fly} 0}}
 You can't fly! Poor thing!
 I give You wings!
 {inc-item-count fly 1}
 {transform-avatar fly}
{else} // else isn't working
 You got wings! Just fly away!

{/if}

2) Or maybe is there a way to use a "Stop" script function?

{if {eq {item-count fly} 0}}
 You can't fly! Poor thing!
 I give You wings!
 {inc-item-count fly 1}
 {transform-avatar fly}
 {stop} // stop function to prevent showing last words in first time
{/if}
You got wings! Just fly away!

3) Or maybe there's other way to prevent showing last words for first time of dialogue?!

PS I'm sorry for my Bad English!

Developer(+1)

At the moment there’s no “else” but you could write a second {if} that’s like {if {gt {item-count fly} 0}} ... {/if}

Just put it before the no-fly script you already have so when you increment the count it doesn’t trigger both conditions.

I’ll see about adding “else” at some point!

(6 edits)

I would ask some more about MOSI:
1) Is there a way to set variables on start game before first steps?
2) Can I make minor NSFW games with nude content on Mosi? Or maybe isn't so good idea?!
3) Is there a way to add new rooms without deleting old locations? I just forgot to add some more rooms.
4) How to get Ending or Game Over? Is there a way to reset game after Game Over?

Maybe bugs:
1) I just try to add some scripts to "On Enter" level function:

Test 1!
{transform-avatar mer} 
Test 2!

All text  working good! But  line  "{transform-avatar mer}" isn't working at all!
But it's working with object scripts.

Developer (1 edit) (+1)

1) You could set them in world “on start” script

2) Sure? Make whatever kinda game you want! I mean, don’t make something fascist or racist or transphobic or whatever, but that’s more a general thing and not specific to Mosi

3) You can export your rooms, resize the world, then import the rooms again - tho I should probably make resizing less destructive at some point

4) Not explicitly, but you could get creative. The point is to create worlds to explore, so I didn’t put in explicit ending or game-over mechanics.

bug) I’ll take a look at this when I have the chance - hopefully this weekend

Thanks! :)

Developer(+1)

I had some time tonight to fix the bug AND added an {else} statement! More info on {else} in the wiki: https://github.com/zenzoa/mosi/wiki/Scripts

Wow!  I'll should to test it!

(3 edits) (+1)

{else} - working good! I like it!

I really like Mosi!

But sometimes my game character is trying to move randomly in any random side few steps. It's strange.
Maybe  it's because I try to use 16x16 pixels sprites and maybe it very laggy for Mosi engine (I don't know!).

Developer

Wow, it's looking great! If you want to share the world data I can try to trouble-shoot the weird movement and the lag.

(2 edits)

Thanks! ^_^
I can share, there's my last version of an experimental game (sorry, it's some with NSFW elements):
https://drive.google.com/open?id=1NWtMNHjmeauOKoUcC3rBHgsGLCFkp2_X

It's strange, but looks like {else} with many levels isn't work good or maybe I just got confused because very hard code in Ghost Enemy.
It's not so easy to read it without Tab and with many many "{" "}" symbols:
I know Mosi is not created for big code, I just trying to test it, is there any possibility to create mini RPG game.

{set-var foelvl 1}
{if {gt {var hp} 0}}
You have battle with enemy!{p}
{dec-var hp {var foelvl}}
{if {gte {var hp} 0}}
{remove-sprite}
{inc-var exp {var foelvl}}
Your Health: {var hp}/{var lvl}{b}
{if {gte {var exp} {mul {var lvl} 2}}}
Exp: {var exp}/{mul {var lvl} 2}
{else}
{inc-var lvl 1}
{set-var exp 0}
{p}YAY! Level Up!
New Level: {var lvl}!
{/if}
{else}
{set-var hp 0}
{set-var wear 0}
{transform-avatar nude}
{p}Your HP is 0, and your clothes torn apart!
{/if}
{else}
{set-var air {var lvl}}
{transform-avatar soul}
{move-avatar deep 3 7}
{p}You're dead!
{/if}
Developer

It looks like this is saying:

  • if I start the battle with more than 0 hp, battle the ghost and decrease my hp
    • at that point if I have 0 or more hp, I win the battle and gain xp
      • if I have enough xp, I gain a level
    • I have less than 0 hp after the battle, I lose my clothes but my hp is reset to 0 (so I don't die)
  • if I start the battle with 0 or less hp, I'm dead

Is that correct? It seems to work that way in the game when I tested it. I also did a simpler test of nested if/else statements, and that worked for me.

Looks like is correct. It's strange.

There's text version:
https://drive.google.com/open?id=1ht-We9iXep1tWZtwT_0v133dJy0ZGa33

Developer (1 edit)

Thanks! I'm not seeing the random movement or slow-downs you mentioned, but I've only tried it in Firefox so far. What browser/os are you using?

(1 edit)

I just use Google Chrome. Maybe I should to try Mozilla Firefox.

Maybe it's because my notebook is not so fast.

(3 edits) (+1)

Thank You so much! :)
I like Mosi! It's awesome!