So close

● ARCHIVED · READ-ONLY
Started by Indsh 6 posts View original ↗
  1. Hello,

    I am making a game that needs events to be deleated by there map id. I feel I am near there but this code is coming up with the error "Unexspected numbers". Anybody no whats going wroung, once I get this sortd my whole system should work

    if ($gameMap.event(this._eventId).x === $game_variables [3] && $gameMap.event(this._eventId).y === $game_variables [4]) {SelfSwitch 20 true;}

    Any help appricated. V
  2. I've just startet learning JavaScript, so I don't know everything about it.

    But is this code exactly the same you're using? Or did you mistyped some parts?

    I'm asking because to me it seems a little odd when I look at

    {SelfSwitch 20 true;}

    Shouldn't there be an equal sign?
  3. if ($gameMap.event(this._eventId).x === $gameVariables.value(3) && $gameMap.event(this._eventId).y === $gameVariables.value(4))


    {


    $gameSelfSwitches.setValue(20, true);


    }
  4. Are you trying to disable an event on the current map, or events on other maps? 

    Changing a self switch requires that you pass in a map id, an event id, and the self switch id (A, B, C, D), as well as the true/false value to denote on/off.

    var key = [mapId, eventID, selfswitchID];$gameSelfSwitches.setValue(key, true);

    where mapID and eventID are numbers (no leading zeros), and selfswitchID is 'A' to 'D'.
  5. I have the Self Switch Plugin for MV, where the call is (SelfSwitch [n] true);

    I will try what you have all suggested when I get to the right computer thank you very much. V
  6. Indsh said:
    I have the Self Switch Plugin for MV, where the call is (SelfSwitch [n] true);

    I will try what you have all suggested when I get to the right computer thank you very much. V
    If that is the syntax, then you're missing the brackets around the number.

    Like this:

    {SelfSwitch[20] true;}

    I think that's why the error message says something about "unexpected numbers".