Page 354 of 396

Re: Ask a simple question, get a simple answer

Posted: Thu Oct 29, 2020 12:54 am
by IttaBitta
Um... could you dumb it down a little? >.>

I wish I could record how I set them up in the preview :/
I can handily organize them with the ol' click&drag

Image

but as it stands I can't parse a line of that second code. Timing's not really a problem, I just need to know how to put them in the RIGHT places

Re: Ask a simple question, get a simple answer

Posted: Thu Oct 29, 2020 4:18 am
by Isaac
Each object has a subtile X&Y coordinate/offset. The intra-tile positions of items can be shifted using the :setSubtileOffset(x, y) function of the game object. Vertical positioning can be done using the :setWorldPositionY() function.

https://github.com/JKos/log2doc/wiki/Ob ... #methods-1

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 30, 2020 6:20 am
by IttaBitta
unrelated question: is there a way to bury something other than a chest?

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 30, 2020 8:19 am
by Zo Kath Ra
IttaBitta wrote: Fri Oct 30, 2020 6:20 am unrelated question: is there a way to bury something other than a chest?
Yes you can:
Put a floor_trigger on the map.
Check its "triggeredByDigging" box, and uncheck the other boxes.
Also check its "disableSelf" box, so the player can only dig it up once.
Then connect it to a script that spawns an item.

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 30, 2020 8:54 am
by IttaBitta
Zo Kath Ra wrote: Fri Oct 30, 2020 8:19 am Yes you can:
Put a floor_trigger on the map.
Check its "triggeredByDigging" box, and uncheck the other boxes.
Also check its "disableSelf" box, so the player can only dig it up once.
Then connect it to a script that spawns an item.
I was trying to summon a different kind of container but it doesn't seem to let me effect what's in THAT

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 30, 2020 6:32 pm
by Zo Kath Ra
IttaBitta wrote: Fri Oct 30, 2020 8:54 am I was trying to summon a different kind of container but it doesn't seem to let me effect what's in THAT
Post your code and we'll see what we can do.

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 30, 2020 7:06 pm
by ratman
What type of container? An item (like a sack or wooden box) or another chest-type object?

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 30, 2020 7:14 pm
by Skuggasveinn
IttaBitta wrote: Fri Oct 30, 2020 8:54 am I was trying to summon a different kind of container but it doesn't seem to let me effect what's in THAT
I did a tutorial about digging stuff up, in this tutorial I hooked a script to the floor trigger just like Zo Kath Ra suggested.
https://www.youtube.com/watch?v=T9vM91bLUY8&t=4s

The scripts was

Code: Select all

function hiddencorpse()
      self.go:spawn("floor_corpse")
      self.go:spawn("skull")
      self.go:spawn("rapier")
      hudPrint("You have found a buried body")
      for i = 1, 4, 1 do
      party.party:getChampion(i):gainExp(250)
      end
      hudPrint("250 exp")
      playSound("secret")
end
If you are spawning another container that you want filled with some items I would simply place it below the map populated with your items, and then use the script to move it into position when the party digs.
first use print(floor_trigger_1:getWorldPosition()) to get the worldposition of your floor trigger.
And then use yourcontainer_1:setWorldPosition(vec(1, 1, 1, 0)) in the script to set the container where vec is the location you got before.

Skuggasveinn.

Re: Ask a simple question, get a simple answer

Posted: Sun Nov 01, 2020 2:33 am
by IttaBitta
Skuggasveinn wrote: Fri Oct 30, 2020 7:14 pm
IttaBitta wrote: Fri Oct 30, 2020 8:54 am I was trying to summon a different kind of container but it doesn't seem to let me effect what's in THAT
I did a tutorial about digging stuff up, in this tutorial I hooked a script to the floor trigger just like Zo Kath Ra suggested.
https://www.youtube.com/watch?v=T9vM91bLUY8&t=4s

The scripts was

Code: Select all

function hiddencorpse()
      self.go:spawn("floor_corpse")
      self.go:spawn("skull")
      self.go:spawn("rapier")
      hudPrint("You have found a buried body")
      for i = 1, 4, 1 do
      party.party:getChampion(i):gainExp(250)
      end
      hudPrint("250 exp")
      playSound("secret")
end
If you are spawning another container that you want filled with some items I would simply place it below the map populated with your items, and then use the script to move it into position when the party digs.
first use print(floor_trigger_1:getWorldPosition()) to get the worldposition of your floor trigger.
And then use yourcontainer_1:setWorldPosition(vec(1, 1, 1, 0)) in the script to set the container where vec is the location you got before.

Skuggasveinn.
Tried that, now the container(a coffin) is incorporeal for some reason.
I can walk through it but not touch it.
edit: solved the problem, I now have it waiting above ground, just hidden away in a corner, and it works now.

Re: Ask a simple question, get a simple answer

Posted: Sun Nov 01, 2020 3:22 am
by IttaBitta
neeeeeeeeeew question
how would I go about making a button that dispenses cheese into an alcove or on to an altar
I can easily get it to spawn on the floor but that is gross :V