Page 236 of 400
Re: Ask a simple question, get a simple answer
Posted: Wed May 09, 2018 12:09 pm
by Isaac
Curunir wrote:One more thing - there is no real way to collect user keyboard input and make the user type in strings that a script can process, right?
Not for the faint of heart.
It is possible with the GraphicsContext object, via :keyDown(key).
https://github.com/JKos/log2doc/wiki/Ob ... icscontext
Re: Ask a simple question, get a simple answer
Posted: Wed May 09, 2018 12:27 pm
by Xardas
What's with the grimtk input boxes?
Re: Ask a simple question, get a simple answer
Posted: Wed May 09, 2018 1:19 pm
by Curunir
Naaaaah, sound like I'll stick to alcove puzzles and scrolls, user-typed answers sound like one big mess to implement and I'm far from competent when it comes to scripting.
[Edit] Is there a way to check for a specific item on a floor trigger, or is that limited only to entities with the surface component? [/Edit]
Re: Ask a simple question, get a simple answer
Posted: Thu May 10, 2018 5:45 am
by Mysterious
Hi all.
Ok I know that Champion:trainSkill(name, times) adds a Skill and Points to the Skill but, how do I remove a Skill from a champ EG: air_magic or any other Skill they have..?
I am using this script to change my Champs:
Code: Select all
local c = party.party:getChampion(1)
--- Champ 1 ---
c:setName('Tifa Lockhart')
c:setClass('fighter')
c:setRace('ratling')
c:setSex('female')
---Items---
c:insertItem(3,spawn("peasant_cap").item)
c:insertItem(4,spawn("peasant_tunic").item)
c:insertItem(5,spawn("peasant_breeches").item)
c:insertItem(6,spawn("sandals").item)
c:insertItem(14,spawn("party_start_note_1").item)
c:setPortrait('assets/textures/portraits/ratling_female_03.tga')
c:addTrait('orges_mule')
c:removeTrait('agile')
c:setBaseStat('strength',16)
-- Champ 2 ---
local c = party.party:getChampion(2)
c:setName('Fiddler Flint')
c:setClass('rogue')
c:setRace('ratling')
c:setSex('male')
--- Items ---
c:insertItem(3,spawn("peasant_cap").item)
c:insertItem(4,spawn("peasant_tunic").item)
c:insertItem(5,spawn("peasant_breeches").item)
c:insertItem(6,spawn("sandals").item)
c:setPortrait('assets/textures/portraits/ratling_male_04.tga')
c:trainSkill('missile_weapons',1)
c:trainSkill('throwing',1)
c:trainSkill('firearms',1)
c:setBaseStat('strength',12)
c:removeTrait('head_hunter')
c:addTrait('agile')
--- Champ 3 ---
local c = party.party:getChampion(3)
c:setName('Thourun Wisthoff')
c:setClass('wizard')
c:setRace('ratling')
c:setSex('male')
---Items---
c:insertItem(14,spawn("scroll_fireburst").item)
c:insertItem(3,spawn("peasant_cap").item)
c:insertItem(4,spawn("peasant_tunic").item)
c:insertItem(5,spawn("peasant_breeches").item)
c:insertItem(6,spawn("sandals").item)
c:setPortrait('assets/textures/portraits/ratling_male_06.tga')
c:trainSkill('fire_magic',1)
c:trainSkill('earth_magic',1)
c:trainSkill('firearms',-1)
c:trainSkill('concentration',1)
c:setSkillPoints(0)
c:setBaseStat('strength',8)
c:removeTrait('tough')
c:addTrait('strong_mind')
--Champ 4--
local c = party.party:getChampion(4)
c:setName('Zala Lockhart')
c:setClass('alchemist')
c:setRace('ratling')
c:setSex('female')
c:insertItem(3,spawn("peasant_cap").item)
c:insertItem(4,spawn("peasant_tunic").item)
c:insertItem(5,spawn("peasant_breeches").item)
c:insertItem(6,spawn("sandals").item)
c:setPortrait('assets/textures/portraits/ratling_female_04.tga')
c:trainSkill('alchemy',2)
Re: Ask a simple question, get a simple answer
Posted: Thu May 10, 2018 6:03 am
by akroma222
Mysterious wrote:how do I remove a Skill from a champ EG: air_magic or any other Skill they have..?
Any skills that you have defined in a lua script and imported from your init.lua, ie:
Code: Select all
import "mod_assets/scripts/party/skills.lua"
will be displayed in the champion Skills menu tab
If you want to remove a skill from your mod entirely, do not include it in your skills.lua
(and dont import the asset pack's skills.lua either - you will need to re-add the skills you want from the asset pack in your own skills.lua)
To reduce the level of a skill, use:
Code: Select all
champion:trainSkill('throwing', -1)
Of interest here - minmay has pointed out that the game actually records skill levels beyond level 5
Also, here is a script I put together - originally adapted from minmays work with managing Traits - that will manage skill bonuses being added and removed from champions cleanly (without messing up the skill levels)
viewtopic.php?f=22&t=9024&p=88389&hilit ... ger#p88389
Re: Ask a simple question, get a simple answer
Posted: Thu May 10, 2018 9:55 am
by Curunir
Is there any reason why the dungeon_wall_lantern model is floating in the air? The metal casing is not attached to the wall and you can see it floating in space if you stand 1 tile away and look at it.
I dug up the asset pack and the Model class of the asset definition for the lantern has offset = vec(0, 1.5 + 0.2, 0 - 0.2),
To compare, the regular torch_holder's socket has a model offset of offset = vec(0.05, 1.53, -0.25),
I won't even pretend I understand how those values are reflected in the worldspace, but I sort of want to fix the floating lantern definition, if possible. Again, I have no idea if this is not something that cannot be fixed because I haven't seen anyone else make a fuss about it.
Re: Ask a simple question, get a simple answer
Posted: Thu May 10, 2018 1:56 pm
by Xardas
The world has 3 axes (x,y,z). With the offset vector, it is possible to give the object an offset. That means you can move it along the axes, starting at the location you actually placed it. It is also possible to rotate an object in 3 directions.
Just change some of the values and you will see the result.
Re: Ask a simple question, get a simple answer
Posted: Thu May 10, 2018 3:35 pm
by Khollik
Hi Curunir
I had the same issue. Thanks to Isaac I managed to find a way to reposition the lanterns with the functions GetWorldPosition() and SetWorldPosition(). I put a floortrigger at the starting location of the party with a script to move the lanterns. It's quite tedious for I had to do it for every lantern in the game

but at least it works. Surely there is a easier solution.
Cheers
Khollik
Re: Ask a simple question, get a simple answer
Posted: Thu May 10, 2018 4:15 pm
by Curunir
Khollik wrote:Hi Curunir
I had the same issue. Thanks to Isaac I managed to find a way to reposition the lanterns with the functions GetWorldPosition() and SetWorldPosition(). I put a floortrigger at the starting location of the party with a script to move the lanterns. It's quite tedious for I had to do it for every lantern in the game

but at least it works. Surely there is a easier solution.
Cheers
Khollik
Can't you just redefine the object if you're using it in a mod? If you have the proper coordinates, I'd be super grateful!
Re: Ask a simple question, get a simple answer
Posted: Fri May 11, 2018 7:53 am
by Isaac
Question: Is it possible to define an object with a custom editor icon?
(Is it possible to assign a custom editor Icon atlas?)