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

Pages: 1 2 3 [4] 5
46
Development / Script working part of the time
« on: May 12, 2017, 06:16:53 pm »
Hey, I've tried to make a simple npc script, but for some reason it only seems to work half the time....i can load the map and it will work....then literally close and re-open the console and it wont work anymore...then next time it might. It seems like it works about 20% of the time, can anyone tell me the reason for this? Just trying to make her walk at the 1st time on the map up to her point she will be at for the rest of the game and freeze the hero until she is there and has spoken her initial dialog, its the interaction bit at the end which seems to be failing i should mention

Code: ( lua) [Select]
local map = ...
local game = map:get_game()
local hero = map:get_hero()

if game:get_value("open_walk") then
  girl:set_visible(true)
  fake_girl:set_visible(false)
  else
  girl:set_visible(false)
  fake_girl:set_visible(true)

local npc_movement_2 = sol.movement.create("target")
  npc_movement_2:set_speed(64)
--  npc_movement_2:set_smooth(true)
  npc_movement_2:set_ignore_obstacles(true)
  npc_movement_2:set_target(girl)
  npc_movement_2:set_ignore_obstacles(true)
  npc_movement_2:start(fake_girl, function()
  girl:set_visible(true)
  fake_girl:set_visible(false)
  game:start_dialog("girl.down_here")
  game:set_value("open_walk", true)
end)
end

function girl:on_interaction()
    game:start_dialog("girl.hello")
end

I also wanted to make the hero freeze on map start until this quest but I haven't been able to make that function yet, i know its hero:freeze() then hero:unfreeze()

I moved the end at line 24 to 29 and that seemed to help a little but it's still failing about 60% of the time

47
Development / Re: Trying to make an NPC disappear
« on: April 30, 2017, 05:11:23 am »
That's perfect, Once again amazing! I managed to get the extra dialog in myself. I did try using map:on_started() but i didn't put destination inside the brackets though, that wasn't my only mistake :P You're so good at these things.

48
Development / Re: Trying to make an NPC disappear
« on: April 30, 2017, 02:21:33 am »
i also forgot that i needed to change the dialog to a function with
Code: ( lua) [Select]
game:start_dialog("meeting.1", function()
   if answer == 2 then -- No
   game:start_dialog("meeting.1")

49
Development / [Solved ]Trying to make an NPC disappear
« on: April 30, 2017, 02:02:35 am »
Hi guys, I've been trying to make a sensor which on activated a dialog will load from an NPC who will then walk off and vanish, I've tried to make it a save game variable so that the sensor and the NPC are gone forever after this. I can't seem to get my NPC to disappear when the map reloads, I realize the below will make him disappear when the sensor is activated again (which is what it is doing). Can anyone show me how to make it do what I need it to do. I tried lots of things but I can't seem to get it to work

Code: ( lua) [Select]
local meeting_quest_1 = false

function meeting_sensor:on_activated()
   if game:get_value("meeting_quest_1") then
   worker_npc:remove()
   else
      game:start_dialog("meeting.1")
      hero:freeze()
      local path_movement = sol.movement.create("path")
      path_movement:set_path({ 2, 2, 2, 2, 2, 1, 1, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0 })
      path_movement:set_ignore_obstacles(true)
      worker_npc:is_traversable()
      path_movement:set_speed(64)
      path_movement:start(worker_npc, function()
      worker_npc:remove()
      game:set_value("meeting_quest_1", true)
      hero:unfreeze() 
      end)
   end
end

I kept getting these errors when i tried to get it working outside the sensor:on_activated
Error: attempt to index global 'worker_npc' (a nil value)
Error: attempt to index global 'meeting_sensor' (a nil value)
but as those are names of entities on my map...isnt that enough to use them just as : worker_npc:remove() ?

as in
Code: ( lua) [Select]
map:on_started(function()
if game:get_value("meeting_quest_1") then
worker_npc:remove()

50
Development / Re: Trying to make an NPC dialog
« on: April 27, 2017, 06:47:28 am »
Cheers, I will be :) I just don't want to flood the message board with questions ALL the time

Yeah I've watched them countless amounts of times, that's how I've got where I am. I'm trying to make sense of the Lua api as well, I've always got it open next to me whilst I'm trying something, as well as the Christopho tutorial (if there is one). I'm more of a visual learner though so it's hard to understand what it's trying to show sometimes or how to implement it without it actually showing me, I'm getting better though. But that's why i love Christopho's tutorials so much, there's so much info in them, much more than the title suggests. It's amazing how far I've got with just them as reference, I can't wait for the next one. Will probably make me realize I've been doing something else wrong for ages :P

It's a shame he's the only person who does any sort of videos. I've tried watching his live coding sessions because I'm sure I'd learn loads through watching that...But I don't speak French so it's hard to understand whats going on (especially in the chat bar) and youtube translations suck.

51
Development / Re: Trying to make an NPC dialog
« on: April 27, 2017, 02:32:27 am »
Thank you so much, it would have taken me forever to figure that out. I wish there were more little scripts laying around to work with like this as I'm at a point now where i can kind of read and understand scripts but I'm having trouble writing them. But with other scripts to read that relate I find it easier.

I've been reading a lot of the map scripts from other games but without being able to see them in action it's hard to see exactly what happens at what point, ie, i was trying to get a dialog to show after the npc had reached its destination but couldn't figure out how to get it to appear at any point other than instantly. I have now because I was able to find a guy from one of the solarus games who does the same-ish actions (speaking after an action not before) and see where I'd gone wrong

I can't believe you'd done it and replied within a hour...wish I'd have come back online earlier. I tried another 100 things after I'd posted this. Thanks again

52
Development / [Solved] Trying to make an NPC dialog
« on: April 26, 2017, 04:00:40 am »
does anyone know how to make a dialog where the npc will respond 4 ways based on whether i have neither item, 1 of the required items or both.

none     -   need both
sword  -   need shield
shield  -   need sword
both     -   have both!

ive been able to get it so that if i have neither and then one item it works. but when i try to get both, or either, i either cant get it to work or i get 2 dialogs trying to play at the same time (need this and need both)

ive tried setting things like below, but after this i dont know where im going, or if this even right to begin with
Code: ( lua) [Select]
local shield_search_quest_started = false
local sword_search_quest_started = false
local items_search_quest_started = false

  local has_sword = game:has_item("sword")
  if has_sword then
  game:set_value("sword_search_quest_started", true)
  end

  local has_shield = game:has_item("shield")
  if has_shield then
  game:set_value("shield_search_quest_started", true)
  end

  local has_both = game:has_item("shield" and "sword")
  if has_both then
  game:set_value("items_search_quest_started", true)
  end
 
 -- Guy3
function Guy3:on_interaction()

 if game:get_value("sword_search_quest_started") then
    game:start_dialog("Guy3.has_sword")
    else
         game:start_dialog("Guy3.search")
  end
end

-- the other 2 dialogs would be
-- "Guy3.has_shield"
-- "Guy3.found"

If anyone can help I'd appreciate it

53
Development / Re: item icons
« on: April 06, 2017, 11:51:49 pm »
Wow, it seems so obvious now. Once again thanks for the help. Loving the xD mercuris chess. Spent a while on google translating it into broken but readable english...well worth it. God damn zelda is demanding :P

54
Development / [Solved] Item icons
« on: April 06, 2017, 06:30:45 am »
In languages when making a new dialog for an item, you have the properties section. Where are the icons kept/what determines what makes icon 2 a bow for example? I changed the entities/icons.png but still the old zelda icon comes up when the dialog is showing.

55
Development / Re: get_variant in inventory
« on: March 17, 2017, 01:08:36 am »
I hadnt even though of having a sub menu on selection, thats a great idea. To be honest im just playing around at the moment as i really dont understand lua. I only really started understanding the inventory script i have been reading yesterday. I was just trying to figure a way to switch between them.

Id eventually like to have them all on on the screen at the same time on the quest screen, wearable on selection, not assignable to a key...same as id like the sword and shield. Basically i eventually want the oot menu (plus an extra screen for reassigning keys), that probably makes more sense.

(Im on a phone so cant post any code)

56
Development / get_variant in inventory
« on: March 16, 2017, 02:25:51 am »
Im making changes to my inventory names table and i was wondering whether it is possible to call a variant of an item from there? Could i call tunic variant 1 from there so i can also call variant 2/3 to be able to change tunic on pressed? Or would i have to just make 3 seperate tunic items? I know making the 3 seperate tunics would be easier.

Everything i have tried so far has resulted in errors

57
General discussion / Re: HELP
« on: March 15, 2017, 10:11:02 pm »
project_db.dat is on the root of your data folder, wherever you placed your quest files

the link from Diarandor went directly to what you asked for....

game:set_starting_location([map_id, [destination_name]])
eg. if your map is called john and the destination you want him to be at is called purple
game:set_starting_location("john", 'purple')

watch all of Chrisopho's tutorials - they are seriously good, even if you think they aren't relevant to what you want to do, watch them. They have information far beyond what the title suggests, don't just watch them once either, go back and watch them and over time and you will see how something that he does which seems silly complicated at that point to you makes a bunch of sense now. You will also find that he does little things which help your creating, for example when he makes a cave he doesn't plonk down some teletransporters, a destination and then go for it, he will take the time to make a perfect cave, and explain to you how the layers are working or why this certain tile is better for the job at hand. Even now watching them I am still learning new things

read the API...I know its hard. but try and do it...luckily there's so much to be doing whilst making a quest that you have so many other things to occupy your time whilst you are stuck on something else...get into sprite making/editing....that sure occupies your time

58
Development / Re: Items not appearing
« on: March 13, 2017, 12:04:35 am »
You'll need to add them to the quest most probably.

Find them in the quest editor and add them to quest with right click, or add them into the project_db manually.

If its not that then more info is needed

59
Development / Re: Total noob here, need some help.
« on: March 09, 2017, 10:33:39 am »
To make a new hero sprite either load a pre configured one into the sprites folder in your pc.
Or much easier, go to the sprites section in the quest editor and find hero, then select the animation eg walking and there will be a box underneath telling you the png name, click the box next to it and find the png you want instead, if the sprite is a different size then you'll need to mess about with the sizes and the origin (the png you want to use must be in the sprites folder) I found it easier to use the png's already set and draw my pictures over the top in the right place, otherwise your hero could have a shield through his face constantly or be a pixel away from a block hes trying to pull like i did at one point

As for the 2nd question do you mean just repeating the tile? If so you just right click. Theres no need for dragging, click the tile in the tileset and the place with left and place repeatable with right. R will resize the tile

Hopefully this helps

60
Development / Re: Inventory
« on: March 04, 2017, 09:44:27 am »
Wow...that worked a charm. OLB was the one I was using and was where I originally found the hammer.tunic. I did notice that this made enemies not immobilize on collision with the hookshot, a simple fix in the hookshot.lua fixed that. All you have said to me has made a lot of things clearer

Now I have noticed that when an enemy is immobilized, the hammer doesn't cause any damage but the sword/bombs etc still do. As soon as the enemy start to move again (unfreezes) the hammer causes damage again. I've had a look at the hammer.lua and the hookshot.lua to see if there's any on immobilized reaction or anything like that but I can't see anything, as i say the sword and everything else still work fine on an immobilized enemy but the hammer just gets ignored, as though it is on a different layer

Pages: 1 2 3 [4] 5