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 - Max

Pages: [1] 2 3 ... 16
1
Largely depends on your entities' code, too. I had an enemy I'd written kinda poorly that caused lag on my decent laptop with just 5-6 of them. Are they calling functions every few milliseconds? Or just wandering randomly? That'll make a difference.

Out of curiosity, why do you want to merge everything into one map? Seems more difficult to work with, especially if you're putting much code into the map script.

2
The transition between music between maps isn't really seamless either though, haha

Using sensors is exactly how I'd do it too. Using the sensor:on_activated() event to call sol.audio.play_music

You might want two sensors per transition, one to okay the field music, one on the inside of that to play the town music.

3
General discussion / Re: Confused about Copywrite
« on: November 16, 2019, 03:30:25 am »
No, you're right. Any use of Nintendo's copyrighted assets is copyright infringement. The Solarus engine isn't Nintendo though, some people are just using Nintendo assets within their games.

The nuance is that fan-works of fiction are an art form that goes long back into history. Fanfiction is copyright infringement also, but various IP owners take different stances on what they allow.

Nintendo tends to ignore smaller infringements (which is logical, it'd take a lot to prosecute). But if one of the games that uses Nintendo assets got a letter from Nintendo, they'd have to take it down.

The good news is, there's a lot of work in this engine that doesn't use Nintendo assets, lots of which is using open-source assets, which are free for anyone to then reuse if they're so inspired.

4
Your scripts / Do tasks in a certain order to open a door or whatever
« on: November 03, 2019, 06:44:11 pm »
Hey, a while ago someone asked me about something like this on the discord, and just now I figured out a decent script for this so I thought I'd share it in case anyone else needs to do this.

This is some simple code for one of those situations where you want the player to press a number of switches (or talk to a number of NPCs, kill a number of enemies, etc.) in a certain order. This code allows you to just write the names of those entities (switches, npcs, enemies, whatever) into an array in that order:

Code: (lua) [Select]
local switch_index = 1
local switches = {"ordered_entity_2", "ordered_entity_4", "ordered_entity_3", "ordered_entity_1"} --I had several NPCs that you needed to interact with in a certain order

for entity in map:get_entities("ordered_entity_") do
  function entity:on_interaction() --or, entity:on_dead() for enemies, entity:on_activated() for switches, etc.
    map:process_switch(self:get_name())
  end
end

function map:process_switch(name)
  if switches[switch_index] == name then
    switch_index = switch_index + 1
    --show some feedback here so they player knows they did something
    sol.audio.play_sound"switch"
    if switch_index == (#switches + 1) then
      --do whatever happens when you do all the things in the right order:
      sol.audio.play_sound"switch"
      map:open_doors("skull_door")
    end
  else
    --if the player hits one out of order:
    sol.audio.play_sound"wrong"
    switch_index = 1
  end
end

5
Bugs & Feature requests / Re: Cutscene builder bug
« on: October 30, 2019, 08:34:57 pm »
Map:on_started is called before isn't a good place to start this. Map:on_opening_transition_finished() is called after on_sarted, and also the hero is automatically unfrozen after the transition is over, which is probably the issue you're solving with the 1sec delay.

Try calling this from on_opening_transition_finished, that might fix it

6
Development / Re: how to make a 'code/password'
« on: September 21, 2019, 04:24:42 pm »
Probably a reasonable, simple way to do it is like

Local failed = false
function enemy_1:on_dead()
  if enemy 2 or 3 is dead
    failed = true
  end
end

function enemy_2:on_dead()
  if enemy 3 is dead or enemy 1 is alive
    failed = true
  end
end

function enemy_3:on_dead()
  if enemy 1 and 2 are dead and failed = false
    Open door
  end
end


I don't want to type actual code on my phone, lol. But map:has_entity("enemy_1") will return true if they're around, false of they're dead.

This isn't the most elegant way to do this, but it's simple to understand. Honestly when I started typing I thought it'd be a lot simpler lol. If you wanted to do more than 3 enemies in a certain order, this would get bad though. Then you'd want an array of enemies that checked if each one before it was dead and each one after it was alive probably.

7
Your projects / Re: Ocean's Heart Beta Testing
« on: September 15, 2019, 01:50:45 am »
Hi Wuzzy. I've communicated with you twice since you sent that message, explaining that the first round of beta testers finished up, the game is undergoing some big changes, and I am planning another round of beta tests in October-November.

Quote
I'm currently between betas for Ocean's Heart, but around October-November (roughly), I'll be opening another closed beta.

If that's not working for you I understand, you're free to have the clarity you need to move on then. Thanks!

8
Development / Re: Text box appearing when getting an item
« on: September 14, 2019, 03:28:51 am »
Yeah, the on_created event is called before the game starts. It creates all the items, it's better than not creating the item in memory until you get it for a lot of reasons.

On variant changed would be the right place, but I still can't figure out why it wouldn't be playing automatically. If you game is on gitlab or GitHub I can pull it down and take a look if you want. Have you made other items and the dialogues display automatically?

9
Development / Re: Text box appearing when getting an item
« on: September 13, 2019, 02:54:37 am »
Could the sword item in that pack being in a subdirectory also be a factor? Also just gave a cursory glance.

10
Development / Re: Text box appearing when getting an item
« on: September 12, 2019, 04:19:54 am »
I dropped your item's code into my sword item, and it displayed the dialog when I picked it up, so it's not your code there, and if you're getting any dialogs at all, it's not setting the language in main.lua.

Your item is called "sword", right? Since the engine uses the item's name to search for a matching dialog in the _treasures dialogs. That's the only other thing I can think of at the moment :^0

11
Development / Re: Text box appearing when getting an item
« on: September 11, 2019, 02:09:23 pm »
Hmm, it's probably just a small mistake, but it's hard to say where if you aren't getting error messages.

If you set the item as a pickable, instead of in a chest, do you still not get the dialogue? If there's no dialogue for an item you pick up as a pickable, there will just be a 1-2 second pause where the hero is holding the item and nothing is happening. If that pause is happening, it's definitely the item not finding the dialog. Does the item's script have item:set_brandish()? The item might be not displaying the dialog because of some code in the item.

12
Development / Re: :on_interaction_item(item_used)
« on: September 07, 2019, 02:17:22 am »
I think what you're missing is fundamentally misunderstand what an "item" is in this context.

If I say x = 1
Then x is a number

If x = "boomerang"
Then x is a string

If x = y
Then x is whatever the variable y is.

Right now you're saying
`if item_used == x then`
But you haven't defined the variable x. You have to tell the code that by the variable x, you mean the equipment item named boomerang, so you need to use a game method to get that equipment item.

```
local x = game:get_item("boomerang")
if item_used == x then ...
```

13
Development / Re: Prevent attack command from attacking
« on: August 26, 2019, 07:54:05 pm »
Can you post the things you tried? Like the actual code, you said you used on_state_changed() but like, HOW did you use it?

14
Development / Re: Seach for an entity?
« on: August 14, 2019, 12:49:19 am »
Oooh, I see. I'd argue that you're trying to solve the wrong problem. The issue isn't that you need to stop enemies from moving, you really SHOULD be suspending the game for this, and you need to figure out how to show the animation you want anyway.

Which is pretty simple:
Code: [Select]
hero:get_sprite():set_ignore_suspend(true)
I mean, your solution technically works so it's not wrong, and maybe should is a strong word. But effectively what you're describing is you do want the game to suspend. You don't want enemies moving, or starting attacks, you wouldn't want NPCs to keep walking around, you wouldn't want some timer you've set to go off, etc. If you don't suspend the game you leave yourself open to a lot of potential conflicts I think

15
Development / Re: Seach for an entity?
« on: August 12, 2019, 01:40:11 pm »
Oh, you had been typing enemy:freeze(), so I assumed that was a method you'd added yourself to the metatable or something.

Depending on how simple you enemies are, you might be able to add an enemy:freeze() method, as long as you remember to deal with the fact that all when an enemy is damaged, all timers and stopped on them and enemy:restart() is called.

If you don't want to do that, unfortunately enemy:immobilize() is the only option, and you can't set the length of time they're frozen and there's no way to unfreeze them.

Pages: [1] 2 3 ... 16