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.

Messages - PhoenixII54

Pages: 1 [2] 3 4
Bugs & Feature requests / Re: Lttp tileset not being recognized.
« on: July 21, 2019, 07:24:27 PM »
It may sound dumb, but did you register the tileset to the database using "add to quest" right-click option in the file tree?

Development / Re: How to configure game window
« on: July 20, 2019, 09:19:36 AM »
To make sure I am understanding this right, you mean to say the code should look more like this?:

Code: [Select]
map_meta:register_event("on_started", function(camera)

In occurence, it will have to be
Code: [Select]
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

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

Code: [Select]
they should have instead written

Code: [Select]

, right?

Exactly, that's the spirit.

Development / Re: How to configure game window
« on: July 19, 2019, 10:43:12 PM »
Actully, what differenciates 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

Anyway, your code is missing an important thing: when you called
Code: [Select]
map_meta:register_event("on_started", function()
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.

Development / Re: How to configure game window
« on: 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

Your projects / Re: Story Idea: Zelda cross Time Crisis
« on: June 13, 2019, 09:46:45 AM »

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!

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.

General discussion / Re: Estpolis sprites
« on: August 29, 2018, 11:04:23 AM »

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.


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={}

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

local debug={   <---la variable fautive

function gu:is_debug_enabled()
  return debug.enabled

function gu:show_debug_hud()
  return debug.show_debug_hud

function gu:show_grid_marker()
  return debug.show_grid_marker

--<plein de fonctions de management de quete>

return gu

Quand je lance la quete, j'ai ce message d'erreur :
Code: [Select]
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 !

Your projects / Re: Zelda's Adventure: Solarus Edition
« on: June 14, 2018, 04:21:26 PM »
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).

Your projects / Re: Zelda's Adventure: Solarus Edition
« on: June 14, 2018, 02:33:00 PM »
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: [Select]
[code= lua]  at start of your code is helpful indeed

Your projects / Re: Zelda's Adventure: Solarus Edition
« on: June 14, 2018, 02:05:25 PM »
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

Your projects / Re: Zelda's Adventure: Solarus Edition
« on: June 14, 2018, 01:50:31 PM »
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.

Your projects / Re: Zelda's Adventure: Solarus Edition
« on: June 14, 2018, 01:11:31 PM »
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

Your projects / Re: Zelda's Adventure: Solarus Edition
« on: June 14, 2018, 11:22:25 AM »
Self-quote from before, since it is an already known issue :

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 ;)

Your projects / Re: Zelda's Adventure: Solarus Edition
« on: June 13, 2018, 01:35:21 PM »
Aww, i think there are some basic Lua notions you need to understand :

1. when you define functions using
Code: ( lua) [Select]
function <id>, the content of the parenthesis is the declaration of variable(s) that you want to be passed on call
so doing
Code: ( lua) [Select]
function map:on_started(movement:start(traveller_2))is not correct and is likely to generate odd behaviour if not triggering an error.

2. in line :
Code: ( lua) [Select]
  movement:set_path{4,4,4,4,4,0,0,0,0,0}you forgot the parenthesis around the list content, since you wnt to call the set_path function. (which may be why you got the error message in the first place)

3. finally, your movement will never be started since your function call is misplaced (see 1.).

That's all for now, try fixing your script from all points above, and let me know if it is OK.

Pages: 1 [2] 3 4