Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
ItemComponent has a setStackSize() method that lets you change the number of items in the stack. Use that to make a stack of pellets (or any other stackable item).
dm_lock_coinslot decreases its coinsNeeded counter value by 1 each time a coin is inserted, and when the value reaches 0, it disables its LockComponent. So if you want to reuse a coin slot after it's been fully paid, you can just enable the LockComponent again and set the coinsNeeded value again.
Or if you mean that you just want the coinslot to accept an unlimited number of coins, set the coinsNeeded counter value to a negative number; then it will never disable the LockComponent.
dm_lock_coinslot decreases its coinsNeeded counter value by 1 each time a coin is inserted, and when the value reaches 0, it disables its LockComponent. So if you want to reuse a coin slot after it's been fully paid, you can just enable the LockComponent again and set the coinsNeeded value again.
Or if you mean that you just want the coinslot to accept an unlimited number of coins, set the coinsNeeded counter value to a negative number; then it will never disable the LockComponent.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
I am not sure I understand. Can I have an example?minmay wrote: ↑Sat Nov 07, 2020 5:38 am ItemComponent has a setStackSize() method that lets you change the number of items in the stack. Use that to make a stack of pellets (or any other stackable item).
dm_lock_coinslot decreases its coinsNeeded counter value by 1 each time a coin is inserted, and when the value reaches 0, it disables its LockComponent. So if you want to reuse a coin slot after it's been fully paid, you can just enable the LockComponent again and set the coinsNeeded value again.
Or if you mean that you just want the coinslot to accept an unlimited number of coins, set the coinsNeeded counter value to a negative number; then it will never disable the LockComponent.
Re: Ask a simple question, get a simple answer
Spawn an item withIttaBitta wrote: ↑Sun Nov 08, 2020 3:48 amI am not sure I understand. Can I have an example?minmay wrote: ↑Sat Nov 07, 2020 5:38 am ItemComponent has a setStackSize() method that lets you change the number of items in the stack. Use that to make a stack of pellets (or any other stackable item).
dm_lock_coinslot decreases its coinsNeeded counter value by 1 each time a coin is inserted, and when the value reaches 0, it disables its LockComponent. So if you want to reuse a coin slot after it's been fully paid, you can just enable the LockComponent again and set the coinsNeeded value again.
Or if you mean that you just want the coinslot to accept an unlimited number of coins, set the coinsNeeded counter value to a negative number; then it will never disable the LockComponent.
Code: Select all
local var = spawn( spawn stuff here )
Code: Select all
var.item:setStackSize(10)
Code: Select all
spawn( spawn stuff here ).item:setStackSize(10)
Re: Ask a simple question, get a simple answer
To set the stack size of a pellet_box with an id of my_box_of_pellets to 500:
To "reset" a dm_lock_coinslot with an id of my_coin_slot_id so that it will accept 5 coins:
Code: Select all
my_box_of_pellets.item:setStackSize(500)
Code: Select all
my_coin_slot_id.lock:enable()
my_coin_slot_id.coinsNeeded:setValue(5)
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
I'm spawning into an alcove though
...?
...
Code: Select all
tomb_alcove_2.surface:addItem(spawn("pellet_box").item:setStackSize(10))
Re: Ask a simple question, get a simple answer
hello !
how i can stun my party for 2-3 sec plz ?
thx
how i can stun my party for 2-3 sec plz ?
thx
Re: Ask a simple question, get a simple answer
Where are the base conditions defined? I am trying to make my own polymorph potion, except an ogre instead of a bear , and when I look at the polymorph potion definition it says:
So I tried to look at the condition 'bear form', but none of the conditions are defined in the asset pack.
Code: Select all
champion:setCondition("bear_form", 1)
Grey Island mod(WIP): http://www.grimrock.net/forum/viewtopic ... 99#p123699
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: Ask a simple question, get a simple answer
You are right, they are not part of the asset pack. But you can define your own condition, example is here.ratman wrote: ↑Sun Nov 08, 2020 5:32 pm Where are the base conditions defined? I am trying to make my own polymorph potion, except an ogre instead of a bear , and when I look at the polymorph potion definition it says:So I tried to look at the condition 'bear form', but none of the conditions are defined in the asset pack.Code: Select all
champion:setCondition("bear_form", 1)
https://github.com/JKos/log2doc/wiki/Asset-Definitions
Also this topic.
viewtopic.php?f=22&t=14528&hilit=polymorph
kind regards
Skuggasveinn.
Re: Ask a simple question, get a simple answer
setStackSize() doesn't return the ItemComponent, so that won't work. You'll need this:IttaBitta wrote: ↑Sun Nov 08, 2020 9:01 am I'm spawning into an alcove though
...?Code: Select all
tomb_alcove_2.surface:addItem(spawn("pellet_box").item:setStackSize(10))
Code: Select all
do
local pbox = spawn("pellet_box").item
tomb_alcove_2.surface:addItem(pbox)
pbox:setStackSize(500)
end
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
Thanks for all your help, btw
More mod mishaps - I tried to use Zimber's assets and I've had a lot of trouble
Trouble one:
things lead me to think it wants me to 'merge' zim_party with my party definition... but I don't know where or WHAT that definition is.
More mod mishaps - I tried to use Zimber's assets and I've had a lot of trouble
Trouble one:
things lead me to think it wants me to 'merge' zim_party with my party definition... but I don't know where or WHAT that definition is.