Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
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.
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
The SkillManager script will add and remove any skill-based traits accurately
viewtopic.php?f=22&t=9024&p=88389&hilit ... ger#p88389
Last edited by akroma222 on Mon Jun 25, 2018 9:49 pm, edited 1 time in total.
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: Ask a simple question, get a simple answer
Oh!
Also, you can use EquipmentItemComponents to change skill levels - my bad
viewtopic.php?f=22&t=14529&p=107849&hil ... er#p107849
Also, you can use EquipmentItemComponents to change skill levels - my bad
viewtopic.php?f=22&t=14529&p=107849&hil ... er#p107849
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: Ask a simple question, get a simple answer
Well that's even better; (much better actually). 
Re: Ask a simple question, get a simple answer
Thanks Akroma and Isaac !
Both solutions proposed by Akroma work perfectly. Your script will definitely be credited in my mod, Akroma
Cheers
Khollik
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
Hey kelly - you can easily adapt the code from the asset pack Head Hunter trait to suit your needskelly1111 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?
SpoilerShow
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,
}Akroma
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: Ask a simple question, get a simple answer
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
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()Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: Ask a simple question, get a simple answer
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?
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
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.
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.