Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 10-Feb-2014 15:46:45

ProjectSynesthesia
Member
Registered: 10-Feb-2014
Posts: 3

How to make multiple "if" statements ?

Hello there,

We are students and we are trying to do a simple key element in OpenSpace3D for our school project.
In simple terms, we want to achieve this : when the player has the key in is inventory AND push down one button => the door opens.
And of course, if he doesn't have it, the door should not open.

We tried the "if" PlugIt and the "switch" PlugIt with various ways to change variables but we didn't succeded. Do we need to get to the Scol code to do this ?

Thanks for your help. smile

Offline

#2 10-Feb-2014 16:31:11

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: How to make multiple "if" statements ?

you can use the switch plugIT only in your case.

if the user take the key you change the switch state on the door.

on door.click -> switch door.input

default :
switch door.left -> nothing

the user get the key :
get key -> switch door.switch right


so now the switch state is right :
on door.click -> switch door.input
switch door.right-> open door...

Offline

#3 11-Feb-2014 09:53:56

ProjectSynesthesia
Member
Registered: 10-Feb-2014
Posts: 3

Re: How to make multiple "if" statements ?

Thanks a lot, it works perfectly ! big_smile

Offline

Board footer

Powered by FluxBB