INSIGHT INTO LOSING CUSTOM VAIRIABLES.
3 posts • Page 1 of 1
INSIGHT INTO LOSING CUSTOM VAIRIABLES.
Bug report which lead to me making said discovery, if your not one of the debugging team its not neccesary to read this part, read at the EDIT point.
I have a custom vairable set at the start as
scene.my.track = 0
and is altered using
key.bind{"a",{scene.my.track = 3}
key.bind{"s",{scene.my.track = 0}
key.bind{"d",{scene.my.track = -3}
and I have a polygon which has its property "materialVelocity" set to {scene.my.track}
It runs fine, HOWEVER, under saving and loading, OR when you undo the scene, the materialvelocity code vanishes. so on loading, it has to be entered, and on undoing, it has to be entered.
Also, I'd like to add a reminder that motors CCW property does not hold code either in my experience.
INSIGHT -
This will really help you guys having a problem, i have discovered a temporary fix for this problem and why it is occuring. it seems some values algodoo/phun whatever are not taking into account upon saving. I had a suspicion maybe this was occuring, so gave the part a collideset of 127 (as nothing else but planes in the scene had that) and then I opened the phn file in notepad and searched for the polygon with that collideset. i found that materialVelocity wasn't there at all. i added it manually and then opened the scene and the materialVelocity now had the code in it! This is a problem with its ability to save properties with custom variables, and not with the variable type when loading, which i thought it might be as i've lost property codes due variables of incorrect types in the past before while running.
Although I have found a way to open with the right code It is still losing the code on undo however. mind you given undo is really just a bunch of save states, I would guess these problems are related.
I hope this is a help to both the scene makers and the debuggers, i'm going to try and make my tv work properly on load as well now using the same technique as before.
EDIT:
I have successfully got a scene now to load with the custom vairiable it had lost! The TV scene i had created I was losing the code under the property "CCW" on a hinge, which im sure a lot of people have had problems with in the past.
I copied the hinges colour, then closed algodoo.
then opened the Phz file and extracted the scene.phn.
I opened the scene.phn in notepad and then searched for the hinges colour. once i found it;
each variable was seperated by a ";" and a square like this [] i copied both and pasted again inside the properties of the addHinge.
I now added the code that was missing, in this case, CCW = {scene.my.ccw}
I saved the file, then added it back into the Phz overwriting the scene.phn that was in there.
Reopened the file in algodoo and the code was in the correct place and the scene operated properly!
Only thing to note is that the problem still existed that if you use undo, the property will still lose its code, But this will allow your scenes to function upon opening. I may repost this in the tutorial section, I litterally only just found all this out as i was posting the bug report.
FURTHER EDIT :
okay, i have discovered you can get the phn back into the phz, and algodoo will open it BUT the doobox will not allow the phz to be uploaded, so you will have to upload just the phn if you do this. which means you scene will not have an image.
question is do you want an image or a functional scene...
Author: Torpedo
Title: Monochrome Laser Cathode Ray 15x5 TV - now with no code adding!
File Size: 84.02 kB
Rating:


Either a way to put a new image on, or a way to fiddle the checksums needed now lol
I have a custom vairable set at the start as
scene.my.track = 0
and is altered using
key.bind{"a",{scene.my.track = 3}
key.bind{"s",{scene.my.track = 0}
key.bind{"d",{scene.my.track = -3}
and I have a polygon which has its property "materialVelocity" set to {scene.my.track}
It runs fine, HOWEVER, under saving and loading, OR when you undo the scene, the materialvelocity code vanishes. so on loading, it has to be entered, and on undoing, it has to be entered.
Also, I'd like to add a reminder that motors CCW property does not hold code either in my experience.
INSIGHT -
This will really help you guys having a problem, i have discovered a temporary fix for this problem and why it is occuring. it seems some values algodoo/phun whatever are not taking into account upon saving. I had a suspicion maybe this was occuring, so gave the part a collideset of 127 (as nothing else but planes in the scene had that) and then I opened the phn file in notepad and searched for the polygon with that collideset. i found that materialVelocity wasn't there at all. i added it manually and then opened the scene and the materialVelocity now had the code in it! This is a problem with its ability to save properties with custom variables, and not with the variable type when loading, which i thought it might be as i've lost property codes due variables of incorrect types in the past before while running.
Although I have found a way to open with the right code It is still losing the code on undo however. mind you given undo is really just a bunch of save states, I would guess these problems are related.
I hope this is a help to both the scene makers and the debuggers, i'm going to try and make my tv work properly on load as well now using the same technique as before.
EDIT:
I have successfully got a scene now to load with the custom vairiable it had lost! The TV scene i had created I was losing the code under the property "CCW" on a hinge, which im sure a lot of people have had problems with in the past.
I copied the hinges colour, then closed algodoo.
then opened the Phz file and extracted the scene.phn.
I opened the scene.phn in notepad and then searched for the hinges colour. once i found it;
each variable was seperated by a ";" and a square like this [] i copied both and pasted again inside the properties of the addHinge.
I now added the code that was missing, in this case, CCW = {scene.my.ccw}
I saved the file, then added it back into the Phz overwriting the scene.phn that was in there.
Reopened the file in algodoo and the code was in the correct place and the scene operated properly!
Only thing to note is that the problem still existed that if you use undo, the property will still lose its code, But this will allow your scenes to function upon opening. I may repost this in the tutorial section, I litterally only just found all this out as i was posting the bug report.
FURTHER EDIT :
okay, i have discovered you can get the phn back into the phz, and algodoo will open it BUT the doobox will not allow the phz to be uploaded, so you will have to upload just the phn if you do this. which means you scene will not have an image.
question is do you want an image or a functional scene...
Author: Torpedo
Title: Monochrome Laser Cathode Ray 15x5 TV - now with no code adding!
File Size: 84.02 kB
Rating:


Either a way to put a new image on, or a way to fiddle the checksums needed now lol

-

Torpedo - Posts: 120
- Joined: Mon Aug 31, 2009 8:51 pm
Re: INSIGHT INTO LOSING CUSTOM VAIRIABLES.
Thanks
Dont know if i went on a bit too much there but i hope its useful to people trying to get a scene to upload with code. although you cant get it with an image, I've figured i'll upload the scene that needs code editing, then upload a scene response that doesn't need code editing (but will have no image as it is a modified .phn file) and just link to the response in the main scene.
Post was probably a bit rude as i imagine your already aware of the problems causes, sorry if it did seem that way !
Got a bit carried away when i found a solution lol
Post was probably a bit rude as i imagine your already aware of the problems causes, sorry if it did seem that way !

-

Torpedo - Posts: 120
- Joined: Mon Aug 31, 2009 8:51 pm
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests



