a real play-mode

Suggest changes and improvements to Algodoo.

a real play-mode

Postby DrAgon » Fri Jun 26, 2015 9:16 pm

Right now, one can switch back the scenario from playmode to non-play-mode,
allowing the user to alter the scene and this way circumvent some problems that i set to
give his brain something to and play with.
In
http://www.algodoo.com/forum/viewtopic.php?f=12&t=11159&p=80327#p80327
i precisely formulated my desires and requirements for this to work,
and also that i would spend quite some money ( i can afford 400 Euro ) as a reward if
someone of Algorix can make this work for me and other teachers.
:thumbup:
User avatar
DrAgon
 
Posts: 31
Joined: Tue Feb 12, 2013 4:03 pm

Re: a real play-mode

Postby homieeee » Sat Jun 27, 2015 4:43 am

Hey DrAgon there should be no need to make a separate Algodoo just for this type of scene. I have made what you need and all it uses is the built in thyme! All you have to do is:

1. Open the scene you want to convert to "Quest Mode"
2. Pick any object in the map
3. Right click on the object and open script menu at the bottom
4. Copy and paste this into the text box in the top left of the script menu
Code: Select all
onspawn = (e)=>{
   Scene.addBox {
   update := (e)=>{
      sim.running = true;(scene.my.backup)?{density = 0}:{}
   };
   density := +inf;
   postStep := (e)=>{
      sim.running = true;
      Tools.DragTool.strength = 100000;
      Tools.DragTool.maxForce = 10000;
      Tools.DragTool.SelectTool;
      App.GUI.playMode = true
   };
   colorHSVA := [0,0,0,0];
   collideset := 0;
   drawBorder := false;
   pos:=[0,0];
   }
}


5. save the scene and you're done!

I recommend you do NOT overwrite the scene since once this is done you will not be able to edit the scene easily.
Just in case you forget this i added a backup. Press "`" (tilde) and type "scene.my.backup = true" and you will be able to edit as normal.

This code will force the user to use drag tool only, disables pausing and undoing, and you can change the drag strength in the code provided (Tools.DragTool.strength)

If there is something else this needs just ask and i'll do my best to fix it!
User avatar
homieeee
 
Posts: 14
Joined: Thu Oct 09, 2014 2:13 am

Re: a real play-mode

Postby DrAgon » Sat Jun 27, 2015 11:59 am

:clap: :clap: :clap: Thanks soooo much, homieeee! :clap: :clap: :clap:
You are a wizard!
I tested it and it worked right away!
The "redo"-button works still, but that has no influence on the sim.time, does it? (mytask1)
But even if it has, i can create now nice quests, that even build upon each other:
If player has successfully finished quest1, he gets permission to continue with quest2, and so on
i think that can be done by using thyme: write something in a file and reading from it.
If this works (mytask2) still in play-mode then i am really rescued!
So i will work on mytask1 and mytask2 now.

Thanks again! I didnt expect this forum to be so active and so competent! :thumbup:

(mytask1) done: Though the "undo"-button takes back to a previous time, but that is no problem,
as no achievement in movements can be done by the "redo"-button, because the "redo"-button
restores also the sim.time so: perfect! No way to cheat by using these buttons.
Consequence: we dont have to worry about clickable undo- and redo-buttons.
User avatar
DrAgon
 
Posts: 31
Joined: Tue Feb 12, 2013 4:03 pm


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 6 guests