Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

[SOLVED]Control event from Common event?

Bishiba

Villager
Xy$
0.00
Hi!

I have an inquiry. What I want to be able to do is have a common event that is responsible for a bunch of tiny events.


View below to see example of what I want and how I have it now.

Following text assumes you've gone over the examples:
This basically creates the issue that if I want to change the dialogue I need to replace so many events in the world.

Not to mention that if this would be doable in some ways, either by saving the event as a variable or something the possibilities with this would be a great many!

For example townsfolk could have a lot of random dialogue etc. I come up with more uses for it sometimes but I keep forgetting them.

Also if you did not understand the current issue with why I cant have the dialogue in the example of how I have it now. Basically the event which is the mob gets erased, but the text box is still open. And once you remove the text box, the game enters the battle. Looks really odd.

If you do the random townsfolk conversation thing, the townsperson will start moving again after you click them. Which means that the thing the person was saying is visible even though the person your talking to can go several blocks away from you.

I really hope this works and that there is a way to use actual scripts to make it happen.

Best regards,
Bishiba

Examples:



What I want:

Event: BanditMob
Image: Bandit
Autonomous Movement: Chase script
Trigger: Event Touch

Contents:
Control switches: Bandit encounter = On


Common event: Bandit Encounter Script
Switch: Bandit encounter = On

Contents:

Control Variables: Random.Var = Random 1..3

If: Random.Var = 1
Text: I will slay you in the name of Twinblade!
Else:
If: Random.Var = 2
Text: Let me tell you a story, give me your ears!
Else:
If: Random.Var = 3
Text: My friends Slicem and Dicem are hungry!

Erase event: (Bandit Mob)

Control Variables: Random.Var = Random 1..3

If: Random.Var = 1
Battle Processing: Bandit, Rogue
Else:
If: Random.Var = 2
Battle Processing: Bandit, Rogue*2
Else:
If: Random.Var = 3
Battle Processing: Bandit*2, Rogue


Control Switches: Bandit Encounter = Off.



That's how I want it to be, makes changing dialogue a lot simpler

How it is ATM:

Event: BanditMob
Image: Bandit
Autonomous Movement: Chase script
Trigger: Event Touch

Contents:

Control Variables: Random.Var = Random 1..3

If: Random.Var = 1
Text: I will slay you in the name of Twinblade!
Else:
If: Random.Var = 2
Text: Let me tell you a story, give me your ears!
Else:
If: Random.Var = 3
Text: My friends Slicem and Dicem are hungry!

Control switches: Bandit encounter = On

Erase event


Common event: Bandit Encounter Script
Switch: Bandit encounter = On

Contents:

Control Variables: Random.Var = Random 1..3
If: Random.Var = 1
Battle Processing: Bandit, Rogue
Else:
If: Random.Var = 2
Battle Processing: Bandit, Rogue*2
Else:
If: Random.Var = 3
Battle Processing: Bandit*2, Rogue


Control Switches: Bandit Encounter = Off.
 

Dad3353

Praised Adventurer
@Bishiba ...

I've read through your examples, and read through your problem, but need some clarification, if you would. As I understand it, there's an Event which chases the Party, and, upon contact, provokes, firstly, a random dialogue (one of three in the example...), then a random Battle, equally one of three.
The part I'm not sure about is what happens after the Battle. I'll assume that the Battle is won; does the Mob Event disappear, for ever, or does it get sent to another part of the Map..? When the Map is re-entered, should this Mob Event be active again, to chase the Party once more, or, having been defeated once, the Event is no longer to be triggered..?
Any of these scenarii can be put into place, using Common Events; I use all of these methods at various places of my own Demo. It's just a question of having exactly the right combination for the exact result wanted. You're not far off the solution; just a couple of details more, please..?
 

Bishiba

Villager
Xy$
0.00
@Bishiba ...

I've read through your examples, and read through your problem, but need some clarification, if you would. As I understand it, there's an Event which chases the Party, and, upon contact, provokes, firstly, a random dialogue (one of three in the example...), then a random Battle, equally one of three.
The part I'm not sure about is what happens after the Battle. I'll assume that the Battle is won; does the Mob Event disappear, for ever, or does it get sent to another part of the Map..? When the Map is re-entered, should this Mob Event be active again, to chase the Party once more, or, having been defeated once, the Event is no longer to be triggered..?
Any of these scenarii can be put into place, using Common Events; I use all of these methods at various places of my own Demo. It's just a question of having exactly the right combination for the exact result wanted. You're not far off the solution; just a couple of details more, please..?

I see. Well depends on wheter or not you read the "What i want" or the "How it is" example. In the What I want example, the event is erased after the text has been displayed in the common event. But as far as I know you can only use Erase Event for the actual event being triggered.

In the How it is example, the event is removed after the text has been displayed in the actual event.

As with the action "Erase Event" the event will be there upon returning to the map area.

Did it clarify?

What would be great is if you could have something like this:

I interact with the mob event. The event is saved as a variable. The common event erases the Event variable.

I think this should be doable via scrips, but I am not sure...

Thanks for taking your time.

Best regards,
Bishiba
 

Dad3353

Praised Adventurer
I see. Well depends on wheter or not you read the "What i want" or the "How it is" example...
I read both examples, of course, but still fail to understand the difficulty (maybe it's me..?). When triggered by an Event on a Map, any reference to 'self' in a Common Event references, in fact, the instigating Event. 'Erase Event', used in a Common Event, will erase the calling Event, which will re-appear when next the Map is entered.
Could I suggest having, in the Mob Event, a call to a Common Event which, firstly, triggers the random dialogue, then the random Battle, and ends with 'Erase Event'..? This would have the Text boxes displayed, which will wait for a 'click' on the part of the Player, then a Battle ensues, after which the Mob Event disappears for the duration of one's presence on that Map. Upon leaving, then re-entering the Map, the Mob Event would, once again, chase the Party. Is that not what is required..?
 

Bishiba

Villager
Xy$
0.00
I read both examples, of course, but still fail to understand the difficulty (maybe it's me..?). When triggered by an Event on a Map, any reference to 'self' in a Common Event references, in fact, the instigating Event. 'Erase Event', used in a Common Event, will erase the calling Event, which will re-appear when next the Map is entered.
Could I suggest having, in the Mob Event, a call to a Common Event which, firstly, triggers the random dialogue, then the random Battle, and ends with 'Erase Event'..? This would have the Text boxes displayed, which will wait for a 'click' on the part of the Player, then a Battle ensues, after which the Mob Event disappears for the duration of one's presence on that Map. Upon leaving, then re-entering the Map, the Mob Event would, once again, chase the Party. Is that not what is required..?
Hello mate!

I know you read both, just meant that it depends on which one you read where the erase event takes place :)

Made a little youtube video for you, or anyone else with ideas on how to fix it.
YouTube Video

Edit, partial solve:
After going through this issue with a friend we figured out how to solve it for mobs sort of...
Event Code
Common Event Code
In the common event, the line $gameMap.event($gameVariables.value(38)).erase(); references
the event ID which is set as a variable in the event code as Varaible.ID 38.

If this were applied to townsfolk however, the event would start to wander off whilst the text was visible.

Edit, all problems SOLVED:
Basically by downloading this Yanfly Plugin and adding it to the game you can prevent all events movement by using this plugin command at the top of the common event: StopEventMovement, and then at the end of the common event you put this: AllowEventMovement.

Also in the actual event you need to have a turn toward player movement route if the event has autonomous random movement.

So this thing is now solved!

Thanks guys!

EDIT... This is like the important one........

You could just not use switches to call the events, but rather just use the actual Call event command, at which point the "erase event" actually removes the triggering event... QQ 3+ hours wasted on this, just today.... I still belive you need the Yanfly Plugin referenced above to stop townsfolk moving though.
 
Last edited:
Top