Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - PhoenixII54

#16
Your scripts / Re: [WIP] Ceiling dropping effect (ALTTP)
September 23, 2019, 01:57:22 PM
Sorry for the necropost, but since i will be using MetalZelda's version in a project (the Link's Awakining remake) with some adaptations, i wanted to know if you're okay with us using GPLv3 as a license (with full credits, of course) ?
#17
It may sound dumb, but did you register the tileset to the database using "add to quest" right-click option in the file tree?
#18
Development / Re: How to configure game window
July 20, 2019, 09:19:36 AM
QuoteTo make sure I am understanding this right, you mean to say the code should look more like this?:

map_meta:register_event("on_started", function(camera)
--stuff
end)

In occurence, it will have to be
map_meta:register_event("on_started", function(map, destination) --the destination is optional in our case, but this is for completeness regarding the API examples
  --your map initialization code
  end)


Remember that in that case, the first argument for an event callback is always the object that triggered it (here, the new map).
Quotewhen they wrote

self.get_camera()

they should have instead written

self:get_camera()
or
self.get_camera(self)


, right?

Exactly, that's the spirit.
#19
Development / Re: How to configure game window
July 19, 2019, 10:43:12 PM
Actully, what differenciates foo.bar() from foo:bar() is that in the second case, foo is automatically passed as an argument to the bar function, and thus it is equivalent to writing foo.bar(foo)

Anyway, your code is missing an important thing: when you called
map_meta:register_event("on_started", function()
--stuff
end)

you forgot to add an argument for the map object which is needed to fetch the camera and which is automtically passed by the event. Speaking of "self", your code will be easier to read and debug if you use an explicitely named variable for the first argument.
#20
Development / Re: How to configure game window
July 16, 2019, 09:47:17 PM
It is perfectly possible to achieve this HUD style, by using the camera API to resize and place it on the screen at game initialization time (generaly in the game:on_started event). For the HUD itself, you will likely want to place it in a menus/hud.lua menu script, and use the menu:on_started and menu:on_draw events to build and update the surfaces which you will display on the screen. See this page for more informations about menus, and don't hesitate to peek a view into the team's games to have an inside of their inner works.

Bonus track: you can display the amount of money(?) as "000" using string.format("%03i", your_variable) when building the text surface for the HUD
#21
Hello,

Yes, you can completely create this kind of game :
- You can use mouse events and sprites to handle the reticle and shoot;
- the cover system can be done by overriding the on_command_pressed and on_command_released events
- Ammo management can be done through an item or a simple variable attached to the hero, your choice
- shooted bullets can be either enemies or custom entities, your choice too

So, all i have to say is: let's go!
#22
Actually, the 3 frame limit is to going to belong to the past : the upcoming 1.6 version will -and already does, feel free to check the latest snapshots here- allow to put arbitrary-length tile animations.
#23
General discussion / Re: Estpolis sprites
August 29, 2018, 11:04:23 AM
Hi,

For games like Lufia, you're lucky : talented people already ripped maps and sprites, and sites like The Spriters Resource and VGMaps contain many of those rips, so you may want to begin by searching through them first.

On the other side, if you want to extract data yourself, emulators like snes9x (iirc) provide a tile/sprite viewer with palette changing options.

Hope it'll help you on your spriting quest.
#24
Bonjour,

j'ai un problème avec une varible de mon script de game manager maison :

Code ( lua) Select
--[[
The game utilities

This file manages low-level operations such as save management
and manages game handling operations such as getting/setting hero's parameters
(life, money, position) or initializing the game parameters

Include it in your scripts if you need some function that couldn't get in other ways,
especially in menus or for debug purpose.
--]]

local gu={}
--[[
+---------------+
| GAME HANDLING |
+---------------+
--]]

local file_utils=require("scripts/utilities/files")
--print("[game manager] INFO : Preloading file")
local game=nil

local debug={   <---la variable fautive
    enabled=true,
    show_grid_marker=true,
    show_debug_hud=true,
}

function gu:is_debug_enabled()
  return debug.enabled
end

function gu:show_debug_hud()
  return debug.show_debug_hud
end

function gu:show_grid_marker()
  return debug.show_grid_marker
end


--<plein de fonctions de management de quete>

return gu


Quand je lance la quete, j'ai ce message d'erreur :
Error: In on_started: scripts/system/game_utils.lua:30: attempt to index upvalue 'debug' (a nil value)
stack traceback:
[C]: in function '__index'
scripts/system/game_utils.lua:30: in function 'is_debug_enabled'
menus/hud.lua:50: in function <menus/hud.lua:41>
[C]: in function 'start'
scripts/system/quest_initializer.lua:28: in function <scripts/system/quest_initializer.lua:27>

quand j'essaye d'appeler la fonction gu:is_debug_enabled() depuis un autre fichier.

Hors, dans le même fichier, j'ai une reference a game qui, elle, fonctionne parfaitement alors qu'elle est déclarée dans le même principe (en local dans la racine du fichier donc).

La question est donc : y a t-il un bug du moteur ou ai-je fait une erreur quelque part ?
Merci de m'aider à éclairer ma lanterne :p


UPDATE : ne surtout PAS appaler une variable locale debug, sinon y a conflit avec une classe debug de Lua. Problème résolu !
#25
i tried using your script on my own test map, and it worked perfectly*. The only warning for you is that the movement will stop if your NPC reaches an obstacle. And i have to correct myself : the parenthesis are actually optionnal for a function call with a raw table data for only argument.

*using an already fully configured sprite (ALTTP Zelda)

PS, that means something is likely wrong on your sprite data, and of course your path is wrong : for a back-and-forth movement, you should use opposite directions, (0+4,1+5, 2+6 or 3+7).
#26
i think the final problem in your script is that you didn't add the parenthesis around the path data table, and as a consequence the movement:set_path function is not called, resulting in the movement path to not be set at all (note : each path direction is numbered from 0 (east) to 7 (south-east), using the trigonometric rotation (or if you prefer the anti-clockwise rotation))

PS : as max said, using [code= lua]  at start of your code is helpful indeed
#27
To be simple, "Boolean"  refers to a binary variable which can mean true (value=1) or false (value=0)

For more information, don't hesitate to use your preferred search engine. it won't bite, and will expand your culture 8)

PS :
to understand the importance of boolean concept, remember that the whole modern conputing concept is based of the Boole algebra
#28
Well, at least you got some progress, and that is the most important thing.  :D

your next step is to make your animation loop, and it is fairly simple : right before starting it, just call movement:set_loop(<boolean value>).
Result will be a continuous movement, which will either do a full back-and-forth movement like you intend, or your npc will just go out of the screen forever -or at least until you leave the map or quit the game.
#29
Now this is strange, did you add all four directions in your "walking" anmation set?
If yes, then did you set sprite data to each direction? i suppose that you did, but i wanted to have confirmation

PS : Now that i think, did you create the "walking" set at all ?Again, I suppose that you did, but I wanted to have confirmation
#30
Self-quote from before, since it is an already known issue :

Quote from: PhoenixII54 on May 25, 2018, 11:20:45 AM
The problem is that the engine expects NPC to have 4 sprite directions, and i suppose you only put 2 in your animation. To fix this, you must duplicate some of its directions to have all 4 required, in case you want to add more to the path.

Another thing to precise is that your movement might not loop as you scripted it.Use movement:set_loop() to define whever you want it to loop or not.

Also, you can use timers to enhance your moves, like, walk to point A, wait, turn left, wait, go to point B, wait, etc. I suppose it is not in your priorities yet, but it will definetely add live to your NPC.

Precision : Sprite directions counting always starts from 0, by convention. and reference to : right (0), up (1), left(2) and down (3).

Yes, programming can be difficult, especially for beginners, but by training and not fearing to make mistakes, you will make constant progress as long as you take the time to understand why a particular mistake has been done.

Anyway, hope it helps you fixing this error ;)