Essentially prior to this overworld situation I have a scripted discussion where I set variable 0008 Campsite as 1, and later on I want to use it to see if the player accesses one of two possible campsites on the overworld. During that campsite event I would set the variable to non-1 in order to make the player unable to access that scene again later on. My code is here:
[IMG]http://i.imgur.com/vGwTirk.png[/IMG]
But it's not working at all. What am I doing wrong?
Seems that if I just put an action button trigger that sets the value to 1 it works well, but why can't I do that during the discussion scene?
that is not the placed where the error is - this event will tramsfer the player to campsite if the variable is 1 and to campsite 2 in all other cases.
If it doesn't transport you to campsite2, then the variable is still 1 - so the mistake is in another place and you have to find out why that code that changes the variable doesn't work.
Additionally, please don't crop half the event (and the important parts of the event at that) - page number, page conditions and triggers are important to finding problems in events.
Briefly echoing what Andar just said, it sounds like it isn't the event you screenshot that is the problem... it's the part that changes the variable from 1 to something else.
You stated:
"Seems that if I just put an action button trigger that sets the value to 1 it works well, but why can't I do that during the discussion scene?"
Can you screenshot the entire page (including page conditions & triggers) where you are changing the value from 1 to something else? It would appear that whatever part that is on is probably not running (due to triggers or conditions not being met).
Part of how you worded things is a little confusing.
So the event you're showing us is a transfer event. As I read it when you access the campsite "event" in the overworld it will transfer you dependent on the variable.
Simple so far. Should be working with that stated.
The problem you're saying you're having is when you intend to have the variable set to 1 correct?
If that is the case then the first thing you need to do is probably show that event for a more accurate way to fix the issue.
BUT if I'm reading this right, what you're asking is why you can't set the variable to 1 during the discussion cutscene?
So the problem I see is that you're trying to set the variable in the cutscene which in this instance isn't possible since that's the cutscene the variable is sending you to in the first place. So what you want to do is have an event set that variable for you before you access the campsite. If the problem is you have nothing to do that and you just want the event to occur the first time you access the campsite you should run an Autorun event at the beginning of your game that sets the campsite variable to 1. Then in the discussion change the variable to something else so that the scene can never be accessed again.
Unless you have reason to use the variable in the future like other discussions and cutscenes and you just don't want to waste switches because of that I'd actually say use a switch instead. That way after the scene is complete you can switch it on and the fact that it is on can send you to the "non discussion" campsite.
Hope that helps. Again I'm uncertain if I read too much into it or not.
Thanks for all the responses guys. None of them did much more than enforce my feeling that I do know how variables work, but I did manage to find the problem.
Essentially for some reason this overworld event had a connection (that I can't see anywhere) to a prior scripted NPC that I've made move few tiles down and disappear, as to look it leaving the scene. Because this overworld event copied the actions of that NPC, the event slid down and disappeared, thus making it impossible to enter the next scene where I wanted to, because the event trigger didn't exist where I expect it to be. I created completely new event and now it all works like it should.
I didn't notice this before since I don't like to use the image in the event itself but rather just as a static part of the map in these instances where there is no need to use the tile for anything else than player relocation.