Sketchup game
-
I am building my own code over Prince IO game tht Scott released before few days.
At the moment I want to do two things
- How can I load different .skp files to my game from webdialogue?(I want to do this cause I dont want to go every time to drop down menu from plugins and load the map)
- How can I open a web - browser by left clicking on the model? (Something like onclick function from maybe dynamic components)
Thank you,
Dhruv Adhia -
Well I asked him and he told me to post it on forums. I guess he must be busy , he told me that you will have to create your own ruby script and I just started learning ruby.
-
@dhruv said:
- How can I load different .skp files to my game from webdialogue?(I want to do this cause I dont want to go every time to drop down menu from plugins and load the map)
Not truly professional I'm sure but this works
#RUBY @dlg.add_action_callback("load") {|d, p| a= p.split(",") subDir ="Components/NamesetComponents/" fileName = a[0]+".skp" model = Sketchup.active_model entities = model.active_entities theX = Integer(a[1]).mm theY= Integer(a[2]).mm theZ = Integer(a[3]).mm point = Geom;;Point3d.new theX,theY,theZ txyz = Geom;;Transformation.new point path = Sketchup.find_support_file fileName, subDir definitions = model.definitions componentdefinition = definitions.load path instance = entities.add_instance componentdefinition, txyz theDegrees = Integer(a[4]).degrees theAxis = a[5] rv = Geom;;Vector3d.new(0,0,1) if theAxis == "z" rv = Geom;;Vector3d.new(0,1,0) if theAxis == "y" rv = Geom;;Vector3d.new(1,0,0) if theAxis == "x" tr = Geom;;Transformation.rotation(Geom;;Point3d.new(instance.bounds.center), rv, theDegrees) instance.transform! tr } //JAVASCRIPT function loadSkpFile(){ param = new Array(theFile,theX,theY,theZ,rz,theAxis) param = param.join(",") window.location.href = 'skp;load@'+param }@dhruv said:
- How can I open a web - browser by left clicking on the model? (Something like onclick function from maybe dynamic components)
As I understand it, you can do it with a selection observer, but I haven't figured out the code for that.
Hope this is useful.
Chris
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement