Author Topic: Things id like to learn for the guide  (Read 964 times)

20degree

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
    • Sylvain Personnal Website
Things id like to learn for the guide
« 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:
Code: [Select]
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+

20degree

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
    • Sylvain Personnal Website
Re: Things id like to learn for the guide
« Reply #1 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:
Code: [Select]
function pass_wall:on_exploded()
  map:set_entities_enabled("pass_wall")

end

20degree

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
    • Sylvain Personnal Website
Re: Things id like to learn for the guide
« Reply #2 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+

Diarandor

  • Hero Member
  • *****
  • Posts: 758
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Things id like to learn for the guide
« Reply #3 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.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1041
    • View Profile
Re: Things id like to learn for the guide
« Reply #4 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 :)

20degree

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
    • Sylvain Personnal Website
Re: Things id like to learn for the guide
« Reply #5 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+

MetalZelda

  • Hero Member
  • *****
  • Posts: 504
    • View Profile
Re: Things id like to learn for the guide
« Reply #6 on: September 21, 2016, 11:23:42 am »
Here is the code:
Code: [Select]
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
  1. local item = ...
  2. local game = item:get_game()
  3.  
  4. -- Never forget this, useful if you want to save the item
  5. function item:on_created()
  6.   self:set_savegame_variable("got_glove")
  7. end
  8.  
  9. function item:on_variant_changed(variant)
  10.   -- the possession state of the glove determines the built-in ability "lift"
  11.   game:set_ability("lift", variant)
  12. end

[/quote]

20degree

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
    • Sylvain Personnal Website
Re: Things id like to learn for the guide
« Reply #7 on: September 24, 2016, 01:49:41 pm »
If ive understand?

Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
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+

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1041
    • View Profile
Re: Things id like to learn for the guide
« Reply #8 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

20degree

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
    • Sylvain Personnal Website
Re: Things id like to learn for the guide
« Reply #9 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+

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1041
    • View Profile
Re: Things id like to learn for the guide
« Reply #10 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.

Diarandor

  • Hero Member
  • *****
  • Posts: 758
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Things id like to learn for the guide
« Reply #11 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.

20degree

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
    • Sylvain Personnal Website
Re: Things id like to learn for the guide
« Reply #12 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+