Author Topic: Control Active Leaf???  (Read 3119 times)

Offline Holy_Diver

  • Holy Diver
  • Archmage of Light
  • *****
  • Posts: 2280
  • This account won't read/reply to Private Messages
Control Active Leaf???
« on: September 24, 2009, 10:09:33 pm »
Anyone know what the hell this instruction does exactly :confused:

Ok, if you use it to control the event you're in, it makes sense that it ends the "leaf" you are inside of.

But I've also noticed if you use it to control a different events leaf, it also leaves the "leaf" you're inside of...

Which leads me to wonder if it actually goes directly to the event you just "controlled"...

And if so presumably proceeds thru that leaf?? Though it does not do so if the leaf condition is not met.

One thing this means, is you can't have one leaf controlling the active leaves of other events.

Which is stupid, because it would be perfectly reasonable to have the OPEN MAP event reset a bunch of event leaves (and this also means -- I would think -- if you control the active leaf of another event, you can technically never get out of the leaf you're in.... unless it resets itself and has a branch in it somehow... or the event you controlled in turn returns control to the event you controlled...... controlled. controlled. controlled. controlled. :ninja:)

Why From' Why :confused:


PS: I'm totally serious. If you know from experience precisely how this works, I would like to have a procedural explanation.

Offline dmpdesign

  • Moonlight Retiree
  • Administrator
  • Dark Slayer Destroyer
  • *****
  • Posts: 1864
    • http://swordofmoonlight.com
Re: Control Active Leaf???
« Reply #1 on: September 24, 2009, 11:40:22 pm »
I use this event to control leaves in other events, especially when I attach it to the open map event.  Are you 100% certain it jumps ahead a leaf in the one youre in as well as the one youre trying to control?  I havent seen that happen.
- Todd DuFore (DMPDesign)
Site Founder

Offline Hguols

  • VIP
  • Guardian in Groundal
  • *****
  • Posts: 624
    • Orationem
Re: Control Active Leaf???
« Reply #2 on: September 24, 2009, 11:52:01 pm »
You can use Control Active Leaf as basically a switch leaf command, but it certainly isn't limited to the leaf you're in.  You can switch to any leaf with this command upon event trigger.

If you want to stay in the leaf, then don't use it for the event you're in.  ^_^

More than one CAL per event, the 2nd and after get ignored.  One leaf can only handle one CAL.  No other events can be after a Control Active Leaf, no matter what it does, or they will be ignored.

One example I've used it for was in regards to NPCs talking.  Here's a fresh one:

Woman NPC
Event Name NPC1
Trigger Examine 360 START CONDITION NONE
Leaf00
Standard Message (...)
Control Active Leaf (Target This Event Operation Move Forward One Leaf)
Leaf01
Standard Message (You tell Cledis, he's a no good homewrecker!)
Altar Counter Value = CLEDIS Set to 1
Leaf02
Standard Message (What do you mean I smell!???!!!  Is that all he had to say?  Well, I still love him...)
Control Active Leaf (Target This Event Operation Move Forward One Leaf)
Leaf 03
Standard Message (...)
__________________________

Dwarf NPC
Event Name NPC2
Trigger Examine 360 START CONDITION None
Leaf00
Standard Message (...)

Event Name NPC2a
Trigger Examine 360 START CONDITION Counter Value = 1 (CLEDIS)
Leaf00
Standard Message (Homewrecker my ass!  The dame wreaks like a honeydipper's hands!)
Altar Counter Value CLEDIS Set to 0
Control Active Leaf (Target Other Event NPC1 Operation Move Forward One Leaf)
__________________________


Ok, how this works.  The drawf has two different events on him.  The woman has one.

Talk to the Dwarf NPC first, you'll get nothing but ellipses.  

Talk to the woman first, you'll get some ellipses FOR THE FIRST CONVERSATION.  Talk to her again, she'll bash the dwarf which raises a counter.  Keep talking to her, she'll just repeat her bash.  

Talk to the drawf again, he'll bash her, the conversation will end and he'll mention ellipses after that.  (because of the counter change)

Talk to her after talking to him, she'll say her final piece, and end the conversation.  Conversations hereafter will be ellipses.
__________________________

Not the best example in the world, but it shows multiple ways of how I've used the Control Active Leaf command.
« Last Edit: September 24, 2009, 11:54:46 pm by Hguols »


Probable mucosal damage may contraindicate the use of gastric lavage.

Offline kilroyfx

  • To Game is Human!!
  • VIP
  • Mace Masher
  • *****
  • Posts: 94
Re: Control Active Leaf???
« Reply #3 on: September 25, 2009, 12:53:29 am »
Hi, Hguols is correct.  I have noticed that using some commands like CAL "control active leaf" can get confusing at times. And commands after just get ignored. If you choose to change the leaf of another event, your current event leaf should stay the same but I believe any commands after CAL will never get called whether a condition is met or not. There are other commands that also seem to work non-intuitively, back to back move object commands get weird.  I have learned to experiment and check my work constantly, its too bad there isn't a command reference manual.

One thing to note and remember, if you call "Control Active Leaf" and you are changing the leaf of another event, the current event's leaf will not change but it will start executing your commands from the top the next time you activate it.  The next trigger will not fall through and run any commands after the CAL but instead will re-run all the commands in the current leaf of the current event from the top.

Do you guys agree? This is my experience. I have used a series of IF statements and a counter to get a bunch of dialogue stuffed into an NPC. Just one leaf could hold dozens of display message commands, and choose a bunch at random.  Like creating a weird prophet who always spouts out random riddles, just cut and paste some off the internet and then stuff them into a leaf. Oh yeah it helps not to use words like leaves, leave, left,  when explaining how leafs work.
Cheers

KilroyFx

Offline Holy_Diver

  • Holy Diver
  • Archmage of Light
  • *****
  • Posts: 2280
  • This account won't read/reply to Private Messages
Re: Control Active Leaf???
« Reply #4 on: September 25, 2009, 09:13:44 am »
This seems like another bug to me, unless control flow actually moves to the controlled leaf (which either way is very counter-intuitive/presumably not intended)

The problem is this "bug" severely limits what you can do with the control-active-leaf instruction.



My hypothesis about how this happened is some programmer programmed the control active leaf function to exit the current leaf. Then some other programmer adds the ability to control the leaves of other events, yet no one realizes the instruction is still jumping out of the current leaf (because no one bothered to playtest SoM outside of the KF1 demo, and could give a fuck about patching stuff I'm sure the Japanese user base must've bemoaned to From)



One work around for having a single event control multiple events would be to have an always on with a long ass series of IF instructions tested against a counter that is incremented each pass thru. That's not something you would want to do by hand though. However it could be a way to make a future extended instruction set backwards compatible with the original runtimes. Anyway, I'm stuck deciding if I want to bend over backwards like this, or if I might just settle for a simpler event setup. Like how I ran into this, is if you make a message pop up within some radius, it's very easy for the player to have been in the process of hitting a button that will cancel the message (not realizing the message was coming) ...basically the only fool proof way to work around this is to setup an IF message after the last message to ask them to replay it (doing so with the message itself is not good enough because one of the buttons will cancel the message regardless of what choice is selected) ...the message itself has to be always on in order to be able to repeat it, so you need another radius event to trigger it. I'm not sure what I will decide to do in the end.



Has anyone thought about making an NPC diary like in many of the KF games? Would not be that hard I think if every NPC was an item in your inventory that could replay their dialogue monologue.


PS: Thanks for the in depth scenario Tom!! Got altars on the old mind huh :tongue:

^Makes me wonder about that new game you were dropping hints about~
« Last Edit: September 25, 2009, 09:16:56 am by Holy Diver »

Offline Hguols

  • VIP
  • Guardian in Groundal
  • *****
  • Posts: 624
    • Orationem
Re: Control Active Leaf???
« Reply #5 on: September 25, 2009, 02:17:48 pm »
Heh.  I don't really have "Altars" on the mind - I'm just not the worlds' goodest spellinger.

Actually, its been a minute since I worked on my latest SoM project.  I've been geeked out over a few other things at the moment, one major one is King's Field Additional II, which I beat, and have been writing an FAQ about. 

I've got 8 pages and I'm not to the dungeon walkthrough yet.  ^_^


Probable mucosal damage may contraindicate the use of gastric lavage.

Offline dmpdesign

  • Moonlight Retiree
  • Administrator
  • Dark Slayer Destroyer
  • *****
  • Posts: 1864
    • http://swordofmoonlight.com
Re: Control Active Leaf???
« Reply #6 on: October 12, 2009, 10:17:47 pm »
Just repeated your bug holy...wow thats a lame one.

here was my scenario.

using the harvine flute of course generates a bridge based on a timer.

i have two events, one on each side of the bridge to generate the bridge temporarily.  i then had an event to reset the timer and move both of the other events back to leaf 0 (so the next time you play the flute the bridge will come back and dissappear as it did the first time).

it was only resetting the first one i put in the event...so it is most certainly a bug.
i was able to get around it by making 2 events that were always on that affected each of the other events individually based on the timer reaching a certain number.

what a shame, stack up another bug for SOM.
- Todd DuFore (DMPDesign)
Site Founder

Offline Holy_Diver

  • Holy Diver
  • Archmage of Light
  • *****
  • Posts: 2280
  • This account won't read/reply to Private Messages
Re: Control Active Leaf???
« Reply #7 on: October 13, 2009, 01:21:01 am »
Some of the guys seem to think this is not a bug (I think) but I'm convinced it is. There's no indication that controlling the leaf should cause a change in control flow. There's no reason I can think of to think that the events work this way programatically. So I'm thinking this was a bug created when the decision was made to add the option of controlling other events' leaves, and there was no effort made to realize the instruction was originally intended to only work within the event where the instruction exists.

Of course any testing at all would've uncovered this bug. But I guess with PC there is no quality control regime (as there is with consoles) and From' was just out to make a quick buck, or canceled the development of SOM midstream and decided to just throw what they had on the market. Of course the fact that SOM has been patched and these bugs were not fixed completely blows my mind. Frankly it's criminal, and I think From would owe everyone who bought SOM a refund with the level of buginess happening here. I can't think of anything so bugged. In the states fix CDs would've been sent out and attached to every box, and made freely available by download/mail with proof of purchase. I still can't get over the original retail price, but hell, it's still cooler than everything else, just for what it is...

It kinda blows my mind that From' originally produced business software, and only inadvertently ended up being known for/shifting entirely over to games. I can see why though business software might not have worked out!!!
« Last Edit: October 13, 2009, 01:23:27 am by Holy Diver »

Offline dmpdesign

  • Moonlight Retiree
  • Administrator
  • Dark Slayer Destroyer
  • *****
  • Posts: 1864
    • http://swordofmoonlight.com
Re: Control Active Leaf???
« Reply #8 on: October 13, 2009, 07:14:35 pm »
Most definitely a bug.

I am curious, since all the SOM's are serialized, how many were actually made.  Im guessing this product was limited quantity and probably never actually available in stores in japan.

Of course, without being able to read the manual, I have no idea :)
- Todd DuFore (DMPDesign)
Site Founder

Offline Holy_Diver

  • Holy Diver
  • Archmage of Light
  • *****
  • Posts: 2280
  • This account won't read/reply to Private Messages
Re: Control Active Leaf???
« Reply #9 on: October 13, 2009, 10:26:19 pm »
What do you mean by "serialized"? I'd be shocked if SOM wasn't chiefly/entirely distributed via store shelves. Seems otherwise it would've gone unnoticed. Would explain why it seems pretty hard to come by however.