Hi, I’m working on a project in Lex Talionis and I want to use a custom field called Holy_blood (like in Genealogy of the Holy War). I used the Unit Editor to add that field to all my units, with values like ‘Hanon’, ‘None’, etc.
I’m trying to access the field in a global_event, with something like:
if;unit.get_field(‘holy_blood’) == ‘Hanon’
Alert;{unit.name} has holy blood of Hanon
End
But I get this error:
event_processor: ‘NoneType’ object has no attribute ‘get_field’
I also tried using unit.holy_blood, but that gave me an error unless all units had the field (which I already checked).
Is there a secure way to access custom unit fields in global events?
Am I doing something wrong?
“‘NoneType’ object has no attribute ‘get_field’” means it’s not recognizing the unit as a unit object. Which kind of event (which trigger) are you using? “unit” may not be an available parameter.
A screenshot of the event could probably help a lot.
How are you calling the event? Because yeah, None as the trigger wont do anything because literally nothing is triggering it. Unless youre calling it from an item or skill which it sounds like it isnt the case
Follow up question is what exactly are you checking holy blood for? If its for a skill or item effects or something, you might not even need to set up an event depending on what you want to end up doing
(Also, may i also recommend joining the LT-Maker discord? You’ll be able to get in touch easier with more LT users and probably get faster responses)
That is very vague tbh.
Still, the best way to check if your if statment is working is to just put in the if statment in the intro event of the DEBUG level (its the one with the level_start trigger) and see if it triggers by accessing the level with the Test Current Level option
Like i said, what you describe is very vague, so im not really sure how to help beyond that
I guess my next follow up question is this: once the game detects a unit has holy blood, what do you want the game to do with that information? Like, is this for displaying in the status menu? Something regarding growth rates and/or base stats? Just checking for holy blood doesnt tell me what you want to do with that specifically
Why “very vague”? (I’ve been using the engine again for a month now, there are things I don’t remember.)Before adding exclusive abilities, weapons, and maybe growth bonuses, I think I should see if the engine know that “holy blood” exists.(Later I moved the event to the debug chapter)
Answering your question, yes, something similar to how holy blood works in FE4 (growth rates and/or base stats, etc.)
It was vague because i didnt know what you were trying to do beyond the check.
And with how you’re trying to implement it, maybe using tags would make things easier? Like, have skills and items be only accessible to units with the correct holy blood tag. For example, by having the Eval Available item component on a weapon, you could put in something like ‘Hanon’ in unit.tags to check if that unit has that tag
You can do this with the growths and bases as well. Just have those be skills with the proper bonuses that would check for the proper tags