Solarus-Games English Forum

Solarus => Development => Topic started by: 20degree on September 18, 2016, 09:38:30 PM

Title: Things id like to learn for the guide
Post by: 20degree on September 18, 2016, 09:38:30 PM
Hello,

I have created a map that have some chest that have the Glove item

Here is the code:
local item = ...
local game = item:get_game()

function item:on_obtaining()
  -- the possession state of the glove determines the built-in ability "lift"
  self:get_game():set_ability("lift", 2)
end


I have put on the map some "destructible entity" wich is the (white rock), i indicate that the weight of it is "2".

I am able to lift the white rocks with the glove, but i want on the same map to lift some darker rock that weight "3" with some glove in some other chest. I have tryed to find the "ancien video" of youtube checked the 55 of them; but seem nothing about the gloves?

The idea is to simply make some path on some map. The hero open the chest then can lift the white rocks, but not the darker ones. Trough the path open an other treasure that have some gloves that can lift the darker rocks.

Thank's for the help.

A+
Title: Re: Things id like to learn for the guide
Post by: 20degree on September 19, 2016, 02:01:35 AM
Id like to know how to create some wall that explode with a bomb.

I have tryed to create a full wall at level 0, then put some dynamic entities over. I try to figure out things.

Here is some code ive done:
function pass_wall:on_exploded()
  map:set_entities_enabled("pass_wall")

end
Title: Re: Things id like to learn for the guide
Post by: 20degree on September 20, 2016, 02:03:21 AM
Hello i dont know if any ones have those graphics for the Solarus Game Engine and how it work?

In the directory "sprites/entities", it have the (doors), but when i "open" one of the (door) to see it's sprite in solarus. All i see is no sprite at all, some message saying (missing source image sprite/tileset)? I see also in the same window: closed - (directions), closing - (directions), opening - (directions). But there are still no sprites image in the window. I wonder how this could be possible when the door sprites is not shown, and by putting the "door entitie" and choosing one of the door sprites (it is listed); like if the graphic was in the Solarus game engine??

I would like to simply copy some graphic as a full wall, so as that i could put some bricked wall; and the wall that can be exploded would be like the brick wall. So the "door entitie" i could choose some sprite looking as the brick wall, and say it can be opened by explosing.

Thank's!

A+
Title: Re: Things id like to learn for the guide
Post by: Diarandor on September 20, 2016, 10:11:53 AM
First, you should start by guessing what "missing source image sprite/tileset" means. But surely you already know. ;)

Second, you should read the Lua API whenever you don't know how to do something; otherwise you will not learn. You will find the answer to your question in the Overview of the Lua API for the door entity, in the following link:
http://www.solarus-games.org/doc/1.5/lua_api_door.html
Keep a link to the Solarus Lua API in your browser (that is what I do) because you will be constantly using it whenever you forget something, or just to check the syntax of some functions, etc. Before asking in the forums, one must try to find answers there (if you don't find your solution there, then ask in the forum).

Third, I think you should forget, at least temporarily, about making a guide if you cannot make easy things work. Be realistic, one must be an expert to write a guide about something. I say this for your own sake. For now, focus on learning things, experimenting with the engine. Some tutorials of pure Lua may help you a lot too (there are many in the internet). If you become an expert of the Solarus editor, then you may be able to write a nice guide.

And my last advice: the best way to learn is to learn from the master (Christopho in this case). That means you should watch all his video tutorials on youtube and study many scripts of his games until you understand most of the code, and then start experimenting by making small changes. (Avoid the hud and dialog box scripts if you are still beginning to learn Lua, because these are more complicated, but try to understand all the other basic scripts.)

PS: You don't have to follow my advices if you don't want to. This is just my opinion. I don't intend to be rude.
Title: Re: Things id like to learn for the guide
Post by: Christopho on September 20, 2016, 11:04:10 AM
I completely agree with Diarandor. To write a book one needs a lot of experience. Make some games first :)
Title: Re: Things id like to learn for the guide
Post by: 20degree on September 21, 2016, 01:12:44 AM
I have figure out fiew things by seeing the videos. I'll try to create my own Solarus Zelda game and put asside the book for some time. It's possible that i ask questions about my game, if so i think the subject title would be different from this one.

One thing for sure Solarus is a fantastic software!

A+
Title: Re: Things id like to learn for the guide
Post by: MetalZelda on September 21, 2016, 11:23:42 AM
Quote from: 20degree on September 18, 2016, 09:38:30 PM
Here is the code:
local item = ...
local game = item:get_game()

function item:on_obtaining()
  -- the possession state of the glove determines the built-in ability "lift"
  self:get_game():set_ability("lift", 2)
end



I think that you give your chest a default variant instead of automatially increasing the variant count
The problem is, the glove is upgradable, just like in ALTTP or OOT for example
They use the on_variant_changed() function
So, when you open a chest, the variant automatically increase

Your glove code should be

Code (lua) Select
local item = ...
local game = item:get_game()

-- Never forget this, useful if you want to save the item
function item:on_created()
  self:set_savegame_variable("got_glove")
end

function item:on_variant_changed(variant)
  -- the possession state of the glove determines the built-in ability "lift"
  game:set_ability("lift", variant)
end


[/quote]
Title: Re: Things id like to learn for the guide
Post by: 20degree on September 24, 2016, 01:49:41 PM
If ive understand?

function item:on_variant_changed(variant)
  -- the possession state of the glove determines the built-in ability "lift"
  game:set_ability("lift", variant)
end


The ability "Lift" because it is writen after the word (, variant) it indicate that when the hero open some chess with some gloves it raise the "Lift" as some ( +1 )??

Me what ive done is that ive created some "destructible white rock entity" that can be lifted with a level 2; by indicating the (weight is 2). When i tryed to lift the white rock without the glove in the treasure, the hero could not lift. Ive indicated the item "glove.lua" these codes:
local item = ...
local game = item:get_game()

function item:on_obtaining()
  -- the possession state of the glove determines the built-in ability "lift"
  self:get_game():set_ability("lift", 2)
end


After i created some "destructible darker rock entity" that can be lifter with a level 4. Ive created some gloves of an other color and have told it's "glove2.lua" theses codes:
local item = ...
local game = item:get_game()

function item:on_obtaining()
  -- the possession state of the glove determines the built-in ability "lift"
  self:get_game():set_ability("lift", 4)
end


Ive indicated that when the hero open the first chess it got the first "glove", then the hero lift some white rocks and open an other treasure where it have the "glove2".

Ive also put some dialogs (en):
_treasure.glove.1
"You have got the glove now you can lift some rocks"
_treasure.glove2.1
"You now have the strongest glove, you can lift any things"

I wonder if its the best way?

There is much i must study. I'm progressing "slowly" but surely.

One thing for sure without the peoples help, i'll have difficulty to progress more rapidly.

Thank's to all.

A+
Title: Re: Things id like to learn for the guide
Post by: Christopho on September 24, 2016, 03:25:33 PM
Yes this is a way. Another solution is to have only one glove item with 2 variants, like I did in zsdx and zelda_roth_se
Title: Re: Things id like to learn for the guide
Post by: 20degree on September 24, 2016, 08:14:32 PM
Well as you see Christopho i try to figure out things, it's not easy for me as a beginner; i'm not as smart and intelligent as you are Christopho and many other peoples around here.

If you read this Christopho, an ability that would be nice beside (swim, lift, etc.) would be the ability to "pin" or "stomp" if i remember the correct english word. Like when the hero Link have some item wich is some (hammer), and he "stomp" with the hammer some pipes into the ground; this to open some way in the outside world or for hitting some ennemy. Like a Zelda game that he have used some hammer to pin things or break things. It could have also different hammer's level (variant), that could pin things of a certain weight level. Maybe break some boss armour with the hammer, to reveal the ennemy and hit him with the sword as some Zelda game.

A+
Title: Re: Things id like to learn for the guide
Post by: Christopho on September 24, 2016, 08:28:47 PM
Thanks but I am not smarter than others, I only have more experience. I started my first zelda fangame in 2001.

About the hammer, it is possible to do it in pure Lua, I did it in zelda_roth_se. But it is quite advanced, it requires good knowledge of custom entities. I would not recommend to start by that.
Title: Re: Things id like to learn for the guide
Post by: Diarandor on September 24, 2016, 10:01:35 PM
@20degree:
You cannot start building your house from the top, so in my opinion, you should start by learning Lua.

I agree with Christopho that no one is necessarily more intelligent that others; this is mostly all about effort, perseverance and time invested. (Nowadays, many people usually confuse effort with intelligence, which is annoying and undervalue the effort.) This is like learning to play an instrument: you cannot expect to play a complicated composition if you cannot even read a stave. So I insist on the same: you should start by studying Lua.

You don't need to have programming studies to learn Lua, but it may take many months or even a few years, depending on how much free time you have; so try to be patient and work constantly on it and someday you will see the results, and otherwise do not expect to get nice results. Exactly the same as if you want to learn to play an instrument.
Title: Re: Things id like to learn for the guide
Post by: 20degree on September 24, 2016, 11:03:46 PM
Dont worry Diarandor, i have the perseverance to try to understand LUA. I have tryed the programming with Love LUA, but things dont seem to work when i read some online books about the software. It is supposed to be easy for beginners, but for me it's not!

It have taken me many years to create and program my own Futurepinball tables, my last one as the time i write this message is the "Futurepinball Faxanadu Pinball". Many things i had to program into this, this is beside creating and programming some Milkshape3d models and texture them to put in the game. If you are curious there is a video on youtube by simply searching: "Faxanadu Pinball". So i dont get discouraged to learn LUA because i have an inner motivation. One to create my own Zelda game for me and my friends. This beside making some book to bring more peoples interrested in Solarus Quest Maker Editor.

Having this motivation and seeing the ChristophoZS videos, trying to understand the Solarus DX and reading things here is a great motivation. I know it will take some time and i agree a house must be build with some good foundations at first.

A+