1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice
  2. NOTICE: We will be applying a Xenforo update on Tuesday 25th of February. This means that from approximately 10:00 to 14:00 BST the forums will be offline (or possibly longer). Sorry for the inconvenience! Official Announcement here.

Drag And Drop Drag and Drop if [...] or [...]

Discussion in 'Programming' started by D1Project, Oct 4, 2019.

  1. D1Project

    D1Project Member

    Joined:
    Aug 23, 2016
    Posts:
    29
    Hello,

    Using Drag and Drop, is there a way to do if [...] or [...] ?
    The only workaround I found is to use an "If Expression" and put the whole expression in.

    For example, if I have a boss with 4 phases, but I want him to execute the same action on phase 2 and 4.
    In GML, we would put "if phase = 2 or phase = 3", how would you do it in DnD?

    Thank you!
     
  2. Homunculus

    Homunculus Member

    Joined:
    Jun 20, 2016
    Posts:
    856
    My Drag & Drop knowledge is a bit rusty, but switch actions are probably what you are looking for
     
  3. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,878
    Case actions in GMS 2 D&D automatically imply the closing break, so you can't chain them the way you can in standard GML (i.e. case 2: case 4:).

    Aside from duplicating the actions, using the If Expression action with an expression of phase == 2 || phase == 4 is the correct solution.
     
    ParodyKnaveBob and Homunculus like this.
  4. D1Project

    D1Project Member

    Joined:
    Aug 23, 2016
    Posts:
    29
    Ok, thank you for your replies!
     

Share This Page