[Question] Does <ModType>GiveItem</ModType> function outside of quests?

I've been working on a Title of Office mini-mod, but I've yet to figure out how to grant items. Ideally, I want to be able to give a Title to the sov through tech research, limiting titles to one per faction, and then allow the sov to bestow onto any champion... or him/herself. I'd prefer not to have the titles availible as expensive shop items, which would defeat the purpose IMHO.

So has anyone had any success using the GiveItem tag in ways that don't involve quests?

4,578 views 8 replies
Reply #1 Top

I have tried several ways of doing this but none seem to work. I think giveItem requires that a well defined target is predefined in the system, ie the unit which is triggering a goodie hut or quest event. What you may want to do is create a quest or some some kind of goodie hut, which spawns when you research some type of tech. I think a quest may be your best bet as it will allow you to add some kind of narrative to the acquisition of the item beyond simply researching a technology.

Reply #2 Top

Just for the communities understanding:

16:26    kenata    I have tried using <modtype>giveItem</modType> but it does not do anything
16:27    Cari_Elf    hmm
16:27    Cari_Elf    yeah, it's not directly hooked up
16:28    Cari_Elf    there are modifiers to give items
16:28    Cari_Elf    but they need a target
16:28    Cari_Elf    and modifiers from techs can only handle map or player targets

Reply #3 Top

You can use it inside another item, it has been tested (personal bugfix for those midnight stones I used to bring to be forged, but never got the quest to trigger).

 

However this doesn't help you much with the initial premise...

guess you could spawn a quest with the tech and make it give you the title. But that would ivolve quests, which you didn't want, so I can't help sorry.

Reply #4 Top

I'm not entirely certain what you're aiming for, so this is a bit of a shot in the dark, but:

Why not try it out as a spell instead of a tech? Spells have target values, and if you set it like imbue (sovereign only) it should work to your need?

Reply #5 Top

Kalin, do you know how to make a spell castable only by sovereign? I know Imbue works like that, but I can't figure out how to reproduce it.

Reply #6 Top

It's the <EssenceCost> tag. As long as it has that, normal units can't use it. Unfortunately, a 0 value won't do either, so what I've been doing is:


        <EssenceCost>0.1</EssenceCost>

 

You'll be asked if you want to spend 0 Essence on the spell, but otherwise it works well enough.

 

Reply #7 Top

Cool! Thanks.

I've been thinking about some spells that really could get out of hand fast if you had a lot of casters, but that will solve it.

Reply #8 Top

Thanks to everyone for helping look into this this.

 

@kenata - Hmm... I suppose I could try spawning a goodie hut, I'll play around with the idea and see what I can come up with.

@Xiwi - Good to know about the item within an item bit. This might actually come in handy for something at some point in time.

@Kalin - Thanks for showing me a possible workaround, but my sleepy mind isn't thinking of a way to limit this to having just one type active at a time...