Page 243 of 400
Re: Ask a simple question, get a simple answer
Posted: Mon Jun 25, 2018 9:25 pm
by kelly1111
I am In need of some help. I am trying to make some doors in my dungeon that will only open if the party has a certain amount of items (lets say golden coins for instance) in their inventory
I want some doors to open with 4 coins, 8 coins, 12 coins, 16 coins, etc... the party doesnt loose the coins when the door opens... the more coins you collect the better doors scattered around my dungeon can be opened.
-- what kind of script do I need to make (any example ?)
-- and can the script check stackable items?
anyone here know the game FEZ ... I want it to be like that, ... you collect blocks ... and the more blocks you have the more options open up.
Re: Ask a simple question, get a simple answer
Posted: Mon Jun 25, 2018 9:39 pm
by akroma222
Isaac wrote: ↑Mon Jun 25, 2018 8:59 pm
This is good to know.
I'll update it.
*There is also the 'Fire Mastery' trait to handle, when the ring is removed.
The SkillManager script will add and remove any skill-based traits accurately
viewtopic.php?f=22&t=9024&p=88389&hilit ... ger#p88389
Re: Ask a simple question, get a simple answer
Posted: Mon Jun 25, 2018 9:47 pm
by akroma222
Oh!
Also, you can use EquipmentItemComponents to change skill levels - my bad
viewtopic.php?f=22&t=14529&p=107849&hil ... er#p107849
Re: Ask a simple question, get a simple answer
Posted: Mon Jun 25, 2018 10:24 pm
by Isaac
Well that's even better; (much better actually).

Re: Ask a simple question, get a simple answer
Posted: Mon Jun 25, 2018 11:02 pm
by Khollik
Thanks Akroma and Isaac !
Both solutions proposed by Akroma work perfectly. Your script will definitely be credited in my mod, Akroma
Cheers
Khollik
Re: Ask a simple question, get a simple answer
Posted: Mon Jun 25, 2018 11:23 pm
by akroma222
kelly1111 wrote: ↑Mon Jun 25, 2018 9:25 pm
I want some doors to open with 4 coins, 8 coins, 12 coins, 16 coins, etc... the party doesnt loose the coins when the door opens... the more coins you collect the better doors scattered around my dungeon can be opened.
-- what kind of script do I need to make (any example ?)
-- and can the script check stackable items?
Hey kelly - you can easily adapt the code from the asset pack Head Hunter trait to suit your needs
Code: Select all
defineTrait{
name = "head_hunter",
uiName = "Head Hunter",
icon = 45,
charGen = true,
requiredRace = "minotaur",
description = "Strength +1 for each skull carried.",
onRecomputeStats = function(champion, level)
if level > 0 then
-- count skulls
local skulls = 0 --create a for ord = 1, 4 do loop here to check all champs
for i=1,ItemSlot.MaxSlots do
local item = champion:getItem(i)
if item then
if item:hasTrait("skull") then --check for your special coins here
skulls = skulls + 1 --check stacksize here
else
local container = item.go.containeritem
if container then
local capacity = container:getCapacity()
for j=1,capacity do
local item2 = container:getItem(j)
if item2 and item2:hasTrait("skull") then --check for your special coins here
skulls = skulls + 1 --check stacksize here
end
end
end
end
end
end
champion:addStatModifier("strength", skulls) --check # of coins >> open doors accordingly
end
end,
}
Hope this will have you heading in the right direction
Akroma
Re: Ask a simple question, get a simple answer
Posted: Tue Jun 26, 2018 11:33 am
by kelly1111
Thanks. Akorma. I will fiddle around with the script. I think this is indeed what I wanted.
Re: Ask a simple question, get a simple answer
Posted: Tue Jun 26, 2018 11:58 am
by akroma222
kelly1111 wrote: ↑Tue Jun 26, 2018 11:33 am
Thanks. Akorma. I will fiddle around with the script. I think this is indeed what I wanted.
Just another thought...
You could give the Party a CounterComponent (named coinscollectedcounter ?)...
Using the party's onPickUpItem hook, check to see if a 'coin' item has been picked up...
If so - destroy the coin item and increment the coins collected Counter.
Then you can easily reference # coins collected with:
Code: Select all
party.go.coinscollectedcounter:getValue()
However, this method would really require that the coins not remain actual game objects after being collected/picked up/awarded
Re: Ask a simple question, get a simple answer
Posted: Wed Jun 27, 2018 11:47 am
by kelly1111
Hello Grimrockians....
I want to make a sort of relay (dont know if this is the correct word) .. i'll explain. I need a wall filled with squares (i can moddel this) and each time a coin is inserted into a slot an counter will increment and highlight one of the squares... so that in the end the whole wall is lit when all the coins are inserted.
question: how do I make this the easiest way... with particles of lights (kinda tricky) or is there a way to change the color of a texture applied via an ingame script? ...
Or can this be done with gem sockets ,,, that when you insert a coin a gem appears in a socket (and stays there) ... than make a sort of array with gemsockets ?
can someone point me in the easiest direction to make this?
Re: Ask a simple question, get a simple answer
Posted: Wed Jun 27, 2018 12:39 pm
by Isaac
You might try a model component for each square, and change the emission color of a model component for each coin spent.
You'd carve the wall into squares. This method would produce lit 3D pieces of the wall.
Alternatively, you could use a simple plane (two polygon, triangulated) model, and spawn as many as you need to cover the wall. Place them just slightly in front of it; these can all share the same model. Do the same with the emission color.