1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

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:
    817
    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,698
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice