Item Gift on Promotion

So in Fort Pinewood one of the units is a pupil. I’ve been trying to set up an event where he gets a Flux tome upon promoting to shaman, but despite my best efforts it never works. Any ideas how to do it? Asking for a friend…

I don’t know what Fort Pinewood is. You should elaborate further on that.

Though, one way you could do it is by making an event at the start of the chapter where it checks for the unit’s current class, and then gives them the item.

Context:
Fort Pinewood
And something I should’ve said earlier is that I’m using Vesly’s Promote Command so the pupil will be promoting mid-level, so I don’t think that idea will work.

Just make it an Always Event then. Give it a global flag so it persists between chapters, and unset the flag if he is a pupil so it keeps triggering until he changes class.

I’m gonna be real with you, I don’t know how to set that up. Haven’t messed around with global flags that much.

Here is an example of an event that can be set as an Always Event that’ll give Flux once. The specific flag you use does not need to be one labled “Global flag”, you could use any non-temp Flag as long as you’re sure its not being used for something else.

You can set it as an Always Event in a Chapter’s Event Condition by clicking on the underlined “Event” button on the right side of FEBuilder, just below the “Advanced Editors” button at the top right of FEBuilder.

image

You may need to allocate an additional Always Condition Event if the vanilla Chapter didn’t have any you could replace.

Just replace the Event ID with your new Event ID. Then you can copy this event into any chapter you’d want the event to happen.

Make sure that your new Always Event is above the GameOver Always Event in the list.


Alternatively, you could sent it as an event that happens once at the start of each turn instead of always.

image

You’d set it as an Event under Turn Conditions. Set Turn Start to 1 if you want the event to happen inbetween preps and the start of the Chapter. Set Turn End to 255 if you want the event to happen at the beginning every turn. You can also change Army Phase to something else if you want the event to happen on Enemy or Ally Phase instead.

4 Likes

So it’s working, for the most part. But then I run into the problem that prompted me to make this post in the first place. The flag. This nifty code works ONLY if there’s no flags involved, and you know what that means: A Jefferson Library’s worth of Flux tomes. And when I DO put in flags, it skips over the event during playtesting ENTIRELY, even if I turn off the flag during the start event.

…Can feel my blood boiling.

Might be more efficient to just have the ‘Completion Flag’ of the thing be the flag you’re using instead of putting it into the event, that way the event doesn’t even run after the first time instead of constantly checking. I’m experimenting with the exact same thing in my hack by pure happenstance for one of my characters, so uh… let me know if you need elaboration or something?

I’d like elaboration, yes.

Just set the flag to OFF in the event in case you don’t give the unit Flux. This makes it so it keeps checking until you do give Flux to the unit, and stops once that happens.

I figured it out. Long story, I was using the command “if flag XX = ON, jump to (ID).” In reality, this code checks if the statement is FALSE, not true. So I figured out that by turning the flag off, the check was false and it was skipping my code. By setting it to “if flag XX = OFF, jump to (ID),” THAT fixed it. A little backwards, but OK.

Short story, I’m a freaking idiot.

2 Likes

Tested it out for a bit and nothing seems to have exploded, but anyways, it’s ended up basically the same as @d_h’s
flagstuff
The confiscation order thing is just to remove the previous thing. …but it seems you’ve got it anyways, congrats!

1 Like

It does not. If the flag is ON, the command returns 1 to slot C. If the flag is OFF, it returns 0.


The template then compares slot C to slot 0 (which is always 0), and if the flag is ON it plays the dialogue, if not it skips to the LABEL.

@VelvetKitsune
Just as an aside, as it says flag 0x75 is used to check if chapter 13 is cleared in both routes, so I recommend not using it and instead using one of the flags that are just called “global flag” since they don’t have vanilla usage.

1 Like

Ah, yeah, ordinarily totally, not a problem in my case, but I’m not going to bloat out this thread with stuff about my hack, hah.