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 31-Mar-2014 16:43:45

cel
Member
Registered: 12-Dec-2013
Posts: 51

openspace and variables question

i'm setting up a variable with value int 1 at init, I then compare with if, if it equals 1 speak... but can't get it to work at all... any chance on a little tutorial on how to properly do this??

Thanks in advance

Offline

#2 31-Mar-2014 17:29:08

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

Re: openspace and variables question

Hi !

if you just need to enable / disable a link with only one state, you can use the misc/Switch plugIT instead.

example :
click play -> switch.input
click disable -> switch.switch right
click enable -> switch.switch left

switch.left -> speak.play
switch.right -> nothing or disable message

With var default value 0:
click enable -> var.set value (1 in link param)
click disable -> var.set value (0 in link param)
click play -> var.get value
var.value -> if (with value to 1).equal
if.true -> speak.play
if.false -> nothing or disable message

Offline

#3 31-Mar-2014 17:53:55

cel
Member
Registered: 12-Dec-2013
Posts: 51

Re: openspace and variables question

i just can't get my head around it.... anychance of an example scene.. i have no idea what i'm doing wrong

Offline

#4 31-Mar-2014 17:56:54

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

Re: openspace and variables question

post your sample so I could see what you're doing wrong

Offline

#5 31-Mar-2014 18:19:15

cel
Member
Registered: 12-Dec-2013
Posts: 51

Re: openspace and variables question

Offline

#6 31-Mar-2014 18:41:41

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

Re: openspace and variables question

hmm I'm not sure of what you are trying to do ^^

first you should not use several instances of a plugIT when you don't need it, for example the speech plugIT can take the text in parameter of the play link.
So you should not need 3 speech plugITs if you only want to change the text.

Also the if plugIT trigger the true or false event only when a test is made with a equal or other link. in your sample I can't find any link that start the process.

On var plugIT you call Get value but never use the event link that return this value here var.Value

read carefully the examples I just post above.

Offline

#7 1-Apr-2014 17:13:51

cel
Member
Registered: 12-Dec-2013
Posts: 51

Re: openspace and variables question

ok, got it working... but something strange happens... if I have more than one variable. So I have five integer variables, each being compared by an if plugit.... in my first variable I am comparing if equals, so everything works fine... my second variable performs the same thing and nothing happens, the if plugit doesn't fire.... now if I change the comparison method to different instead of equal everything works fine... so I have to alternate how the variables are being compared... one is if equal, the next if different, then if equal and so on... and this is the only way to have working... is it a bug or am i missing something again?

Offline

#8 1-Apr-2014 17:19:06

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

Re: openspace and variables question

the value compared is sent in the link parameter
you can watch what happen by activating the links log (icon on top right corner of the log zone)

you can also look at the value by linking the event with the misc / debug console plugIT

So you should be able to find where the value you get is 0 and you where looking for 1 for example.
and understand better what happen

Offline

#9 1-Apr-2014 17:22:31

cel
Member
Registered: 12-Dec-2013
Posts: 51

Re: openspace and variables question

did all that... that's how i got it working...

Offline

#10 1-Apr-2014 17:33:02

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

Re: openspace and variables question

so you must miss something smile
try to simplify the project, you sure can manage what you need a simpler way.

explain what you are trying to make.
from what I saw, you try to make different status for speaking process.

If only a path is possible then you should use a sequence plugIT with several speak.play links with the text content in the link parameter.
You can also use Output dispatcher or input dispatcher plugIT that can help for this.

Offline

Board footer

Powered by FluxBB