Is anyone working on a local co-op play? is there an easy way to do it?

Started by Vaero, January 25, 2016, 03:59:52 AM

Previous topic - Next topic

There is no actual way to play co-op in Solarus.
But, Diarandor has a multi-hero controller for single player, maybe if you take this as a base and extend it so the 2nd player can be controlled through another inputs, this should work.

Hi there! Yes, my scripts allow to switch between heroes, but they are only for 1 player, and that is not what you want. My repo is not updated at present. With my scripts, you can switch even between heroes on diferent maps, since all important info of the maps where other heroes are is saved, but this would not be possible for a co-op game since solarus can only load a map at each moment. Anyway, a co-op should be possible if all heroes share the same map and camera, although that would make the game completely linear, like in Triforce Heroes (I do not like that linearity, but that is just my opinion).
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

Hello and Happy New Year everyone (It's still time!) ! So, it would be like Secret of Mana (and seiken 3) on SNES ! I've done this with my game (to test the follower without changing the leader) and it works. (I don't use Diarandor's script because I've my own, but it should be the same!)

Quote from: Yosha on January 26, 2016, 08:11:20 AM
Hello and Happy New Year everyone (It's still time!) ! So, it would be like Secret of Mana (and seiken 3) on SNES ! I've done this with my game (to test the follower without changing the leader) and it works. (I don't use Diarandor's script because I've my own, but it should be the same!)

My scripts are not exactly to make secondary heroes as followers, they stay stopped until you switch, so it's not exactly the same mechanics, only the switching hero function will be similar.

I do not recommend anyone to use my scripts (unless you know what you are doing) since it requires to use other scripts to save info of different maps (where secondary heroes are left), which is a bit complicated to combine with the game manager. However, if someone wants secondary heroes that do nothing and can stay in different maps, then my scripts would be a solution.

PS: Secret of mana and Seiken Densetsu 3 bring me back good memories :D.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

Quote from: Diarandor on January 26, 2016, 02:08:17 PM
Quote from: Yosha on January 26, 2016, 08:11:20 AM
Hello and Happy New Year everyone (It's still time!) ! So, it would be like Secret of Mana (and seiken 3) on SNES ! I've done this with my game (to test the follower without changing the leader) and it works. (I don't use Diarandor's script because I've my own, but it should be the same!)

My scripts are not exactly to make secondary heroes as followers, they stay stopped until you switch, so it's not exactly the same mechanics, only the switching hero function will be similar.

I do not recommend anyone to use my scripts (unless you know what you are doing) since it requires to use other scripts to save info of different maps (where secondary heroes are left), which is a bit complicated to combine with the game manager. However, if someone wants secondary heroes that do nothing and can stay in different maps, then my scripts would be a solution.

PS: Secret of mana and Seiken Densetsu 3 bring me back good memories :D.
That were Good times!
You know that nearly all of use strugled once
with RPG maker. But now we make with
Solarus! 8)

QuoteMy scripts are not exactly to make secondary heroes as followers, they stay stopped until you switch, so it's not exactly the same mechanics, only the switching hero function will be similar.

Well, since my second character can also be stopped on a map, I think it was the same. I don't see your script, and maybe it could be usefull for me for some little trouble I have (especially with tunics which is not save in my script, so I have to use a trick to do it)

I have updated my repository with the new version of most of the scripts:
https://github.com/Diarandor/repository
You can find useful functions in "scripts/hero manager/hero_manager.lua" to change between heroes, but the code of the script is long since it has other many functions for other things, so ask me if you have problems to understand it or use it. Also note that there are lots of features in my scripts that you may not need, so pick the code that you need and delete what you do not need.

If you are allowing to leave some hero in other map (which is my case), there are some problems arising if you leave some hero and then you come back to that map. The main one is that destroyed entities may reappear (so the hero would appear overlapping some entity), platforms could have reseted their position (so the hero could fall), enemies would reappear at their original position, etc. This is solved by other of my main scripts, "save_between_maps.lua", which is a bit technical since it does a lot of things. I use it to save/restore all info I need of any entity left in a map where a secondary hero is; it also saves the positions of npc_heroes (the heroes that you are not controlling) and allows to make companions to follow you to other map if some condition is satisfied (if you have seen my videos, there are cats that follow you to other maps if and only if the hero carries a ball of yarn of the same color, which is the required condition in that case, or also the phoenix chick that always follows you to other maps). You need to define some functions and properties in some of your entity scripts to make this all work as you want.

It is far more complicated than you may expect, but ask me if you have any problem, I will gladly help you.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

Thanks a lot! But for now I'm just working on other things and I don't want to put my head into this. But when I will have some time, I'll look it and maybe this time I'll ask for your help !