Scriptmenue doesn't apply Script..
11 posts • Page 1 of 1
Scriptmenue doesn't apply Script..
HI @,
my problem is, if i write a Script like onCollide:(e)=>{Scene.my.open} in a object that i want to change collision group, if object A collides with object B(onCollide:(e)=>{Scene.my.open = 65}; [65 = A, G] (e.g. if i want to do a door(A), which opens with a magnetic object(G), the scriptmenue doesn't apply my text, the curious thing is, that sometimes it applies, but when I want to save my script it will be reset -.-'
The next thing i can't understand is that for some scripts it applies even if i save the scene o0 xD
I already tried to extract the .phz file and edit the script in the .phn file with text editor, but Algodoo still don't applies it if i want to >.<''
I also tried to delete my config in hope that it will maybe change something, but still the same problem...
I don't know what to do, sometimes it works sometimes not... mostly not ...
(P.s.: Does it makes any difference if i write ":=" instead of only "=")
Sorry for poor english xD, and that the question is maybe a bit noobie, but i just started scripting with Algodoo, and that's the only thing that's not working... up to now ^^
Many thank in advance
my problem is, if i write a Script like onCollide:(e)=>{Scene.my.open} in a object that i want to change collision group, if object A collides with object B(onCollide:(e)=>{Scene.my.open = 65}; [65 = A, G] (e.g. if i want to do a door(A), which opens with a magnetic object(G), the scriptmenue doesn't apply my text, the curious thing is, that sometimes it applies, but when I want to save my script it will be reset -.-'
The next thing i can't understand is that for some scripts it applies even if i save the scene o0 xD
I already tried to extract the .phz file and edit the script in the .phn file with text editor, but Algodoo still don't applies it if i want to >.<''
I also tried to delete my config in hope that it will maybe change something, but still the same problem...
I don't know what to do, sometimes it works sometimes not... mostly not ...
(P.s.: Does it makes any difference if i write ":=" instead of only "=")
Sorry for poor english xD, and that the question is maybe a bit noobie, but i just started scripting with Algodoo, and that's the only thing that's not working... up to now ^^
Many thank in advance
-

Ling-Ling - Posts: 5
- Joined: Mon Feb 22, 2010 10:38 pm
- Location: Germany
Re: Scriptmenue doesn't apply Script..
Are you sure you always press enter after you wrote your script? If you do not it will not be saved.
And yes, it makes a difference if you type := instead of =
= is the assign sign and := is the declare sign. If you want to change the value of a variable you use = but if you want to create a variable that didn't exist before you type in :=
In your example you want to change the value of scene.my.open so you use =. If you open the console and want to create a new variable, you type in :=
And yes, it makes a difference if you type := instead of =
= is the assign sign and := is the declare sign. If you want to change the value of a variable you use = but if you want to create a variable that didn't exist before you type in :=
In your example you want to change the value of scene.my.open so you use =. If you open the console and want to create a new variable, you type in :=

-

KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Scriptmenue doesn't apply Script..
Actually, I never typed := in the console to create a new variable. I always just used =. := is used for assigning perimeters to spawned objects.
TheWinkits wrote:They both looks of cuking amazing
-

Chronos - [Most Active Member 2010]
- Posts: 4457
- Joined: Mon Aug 31, 2009 6:00 pm
- Location: Californania
Re: Scriptmenue doesn't apply Script..
Chronos wrote:Actually, I never typed := in the console to create a new variable. I always just used =.
Yes, algodoo can differenciate between assigning and declaring so you only have to type in = normally. But sometimes it doesn't detect it. So if you only declare variables with = they sometimes won't get declared. You won't recognize it if you don't check all registered custom variables or until some users downloaded your scene and complain about the not working scripting (which nevertheless works on your own PC).
That's why := is bomb proof for declaring variables and = isn't always the best choice.
Chronos wrote::= is used for assigning perimeters to spawned objects.
It's := because when you spawn a new object the object's variables also get freshly created, I guess. So algodoo can differenciate between the old's object variables and the ones which get created for the new object

-

KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Scriptmenue doesn't apply Script..
Yes, i really pressed ENTER to save my script
, then it works, but when i save my scene, and reload it, the script in the collideSet of the door disappears. All the other Scripts were saved, just not the ones where the variables should transfer to.
A: onCollide:(e)=>{scene.my.open = 65}
B: collideSet: {scene.my.open}
--> the "{scene.my.open}" of object B won't apply when i save and reload the scene, it will be reset to " 1 "
A: onCollide:(e)=>{scene.my.open = 65}
B: collideSet: {scene.my.open}
--> the "{scene.my.open}" of object B won't apply when i save and reload the scene, it will be reset to " 1 "
-

Ling-Ling - Posts: 5
- Joined: Mon Feb 22, 2010 10:38 pm
- Location: Germany
Re: Scriptmenue doesn't apply Script..
Ok let's try something different.
► Open the console with F11
► Type in: scene.my.
► Press Tab
And then tell me what will be displayed. Normally all your scene.my. variables will be displayed. If nothing happens tell me about it, too.
► Open the console with F11
► Type in: scene.my.
► Press Tab
And then tell me what will be displayed. Normally all your scene.my. variables will be displayed. If nothing happens tell me about it, too.

-

KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Scriptmenue doesn't apply Script..
this will be displayed:
blink
button
door
jump
length
open
text
- So actually yes - All my variables i created, some of them just to look if it would work if i make a new one xD ... senseless ... yeah but you see the Scene.my.open variable is also in it
EDIT: lol ? i just tried now to type in {scene.my.open} again, and i works ? o__0 even if i save the scene? but... how ? i mean i did the same as before, i've done just nothing ?
blink
button
door
jump
length
open
text
- So actually yes - All my variables i created, some of them just to look if it would work if i make a new one xD ... senseless ... yeah but you see the Scene.my.open variable is also in it
EDIT: lol ? i just tried now to type in {scene.my.open} again, and i works ? o__0 even if i save the scene? but... how ? i mean i did the same as before, i've done just nothing ?
-

Ling-Ling - Posts: 5
- Joined: Mon Feb 22, 2010 10:38 pm
- Location: Germany
Re: Scriptmenue doesn't apply Script..
It's probably that bug where some fields of the script menu don't save the variables.
TheWinkits wrote:They both looks of cuking amazing
-

Chronos - [Most Active Member 2010]
- Posts: 4457
- Joined: Mon Aug 31, 2009 6:00 pm
- Location: Californania
Re: Scriptmenue doesn't apply Script..
Hm yes i hope so... i think i will let you know, if the same problem appears again ^^
so thank you again
Danke KarateBrot
, hast übrigens tolle Szenen 
so thank you again
Danke KarateBrot
-

Ling-Ling - Posts: 5
- Joined: Mon Feb 22, 2010 10:38 pm
- Location: Germany
11 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests



