Page 79 of 400
Re: Ask a simple question, get a simple answer
Posted: Tue Jul 07, 2015 7:57 am
by Isaac
So... Auto use on equip?
Re: Ask a simple question, get a simple answer
Posted: Tue Jul 07, 2015 10:04 am
by AndakRainor
I have a merchant who sells food. I gave two options; eat "on the spot" or "take away". If I can not use an item in the script, then I will have to remove the "on the spot" option, has it won't work for racial bonus food if I do not spawn an actual item and use it. So, is it possible ?
Re: Ask a simple question, get a simple answer
Posted: Tue Jul 07, 2015 10:50 am
by Isaac
You make something with the onEquipItem hook [spawn item, and assign it (addConnector) a hooked function in a script entity, then add it to the Champion's inventory]; and use the equipmentItem component to manually check info and cause the desired effects.
*Speculation.
Re: Ask a simple question, get a simple answer
Posted: Tue Jul 07, 2015 11:15 am
by AndakRainor
In this situation, the desired effects are : update the food level of the champion (done, it works), execute the onUseItem function if it exists (done, it works / example : rotten_pitroot_bread has 50% chance to cause the diseased condition), AND then there is also the racial bonus effects but I have zero control over this part. It seems to be hard-coded. I mean the bonus stats a champion can get when a ratling eats cheese, a lizardman eats turtle eggs or an insectoid eats horned fruits. I have no idea how to do the same thing without the item being actually used manually by the player!
Re: Ask a simple question, get a simple answer
Posted: Tue Jul 07, 2015 11:33 am
by Duncan1246
In my mod, I have some levels with several elevation. So I think that the automap isn't easy to read. I wonder if it is possible to script something to split the automap by elevation?
Re: Ask a simple question, get a simple answer
Posted: Tue Jul 07, 2015 11:53 am
by Isaac
AndakRainor wrote: I mean the bonus stats a champion can get when a ratling eats cheese, a lizardman eats turtle eggs or an insectoid eats horned fruits. I have no idea how to do the same thing without the item being actually used manually by the player!
I don't know what all of those bonuses are offhand, but you can change the PC quite a bit with the champion functions, as far as stats go.
*Have you considered spawning the item onto the mouse? The player has to do something with it, they will probably use it. Might very likely swap it for a weapon and use it; then return the weapon.
Re: Ask a simple question, get a simple answer
Posted: Sun Jul 12, 2015 7:43 pm
by AndakRainor
Hello! I would like to read the resistAll value from an EquipmentItemComponent in a script. It seems it has no get or set function ? I can't access it as I do for example with EquipmentItemComponent:getResistFire(). Also how does this stat work ? Is it additive with for example resist fire ? From the values returned by getResistFire() it seems completly disconnected.
If I don't find a solution I will have no choice but to remove this stat from all items definitions and replace it with readable elemental resistances.
Here is an example of an object with this stat:
Code: Select all
defineObject{
name = "mirror_chestplate",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/mirror_armor_chestplate.fbx",
},
{
class = "Item",
uiName = "Mirror Chestplate",
description = "Light reflected off the polished metal discs on this chest plate shimmers and dances around in a strange fashion.",
armorSet = "mirror",
armorSetPieces = 5,
gfxIndex = 239,
weight = 8.0,
traits = { "light_armor", "chest_armor" },
},
{
class = "EquipmentItem",
protection = 8,
resistAll = 5,
},
},
}
Re: Ask a simple question, get a simple answer
Posted: Sun Jul 12, 2015 8:45 pm
by Isaac
AndakRainor wrote:Hello! I would like to read the resistAll value from an EquipmentItemComponent in a script. It seems it has no get or set function ? I can't access it as I do for example with EquipmentItemComponent:getResistFire(). Also how does this stat work ? Is it additive with for example resist fire ? From the values returned by getResistFire() it seems completly disconnected.
I've not tried this, or looked into it yet, but what stops anyone from just reading all the resistances separately? Couldn't one even write a function in their script that returns all the resistance values for a given PC?
Re: Ask a simple question, get a simple answer
Posted: Sun Jul 12, 2015 9:12 pm
by AndakRainor
Yes the resistances of the champion are correctly modified by the resistAll stat. But as in this script I inspect the values of a given item, I don't think I should swap equipped items to look at champion's stats and try to get a value for resistAll this way. It would be better to directly get this value from the item itself (EquipmentItemComponent).
Re: Ask a simple question, get a simple answer
Posted: Sun Jul 12, 2015 9:16 pm
by Isaac
AndakRainor wrote:Yes the resistances of the champion are correctly modified by the resistAll stat. But as in this script I inspect the values of a given item, I don't think I should swap equipped items to look at champion's stats and try to get a value for resistAll this way. It would be better to directly get this value from the item itself (EquipmentItemComponent).
Ah... there is my answer.
** However... if it all happened mid-frame, I don't believe it would be noticeable to the player.
I'm interested in the solution to this, because I'll probably be doing this myself soon.