3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1] 2

Author Topic: Issues with compiled projects - SOLVED  (Read 176 times)

« on: June 04, 2014, 05:01:06 PM »
Hi guys, and sorry I keep bombarding the forums with my problems  :P

Anyway, I have a project which uses 'iMouseButtonClick(0)', and 'iMouseButtonDown(1)' in a script. This works fine when I run the project in 3dRad. However, when I take the same project, compile it and run it, it does not respond to any mouse button presses. Everything else works fine, including everything in the same script as the 'iMouse' commands

Does anyone know what could be causing this?

Thanks,

G
« Last Edit: June 05, 2014, 07:20:02 PM by georgio123 »
« Reply #1 on: June 04, 2014, 07:23:45 PM »
no problem G... i don't think anyone has any problems with sensible questions, and we know that you've tried to find a solution before asking on the forum...

unfortunately, this is a new one on me... i've never seen the mouse button events be affected differently in the compiled version of an edited project...

dumb question, but there's no Config control object in there that may be reassigning the mouse button, is there...


--Mike
« Reply #2 on: June 04, 2014, 09:29:08 PM »
Hi G....123 I have seen the problem a little bit different, but never took the time to see what was going on.

I had an excremental Network program with a menu on the server and it would not work all the time including in the editor.

Quote
there's no Config control object in there that may be reassigning the mouse button, is there...

I might revisit it and see if this was not the problem my self. May be it might have hidden the mouse cursor if it is a sprite, Stopped instead of Hide. If you use a Event on Input make sure that the Relationship setting is right.

Some more things to check

n_iron
« Reply #3 on: June 05, 2014, 12:26:59 AM »
Thanks both of you for your replies.

Quote
there's no Config control object in there that may be reassigning the mouse button, is there...

No, there was no such object in the project.

Just an update: I tried replacing the iMouseButton commands with script relating to an Event on Input object and I am still having the same issue.

I am wondering (and hoping) that this is only an issue on my computer. I have attached my compiled project for people to test (the one with iMouseButton commands).

WSAD should control the ship. And in case it works, RMB should aim, and LMB should fire the guns around the ship. You have to be facing a valid direction (left, right, or rear) for the guns to work.

Here's the link: http://www.mediafire.com/download/hj5sb7j2o6fwt6i/Problematic_iMouse.zip

« Reply #4 on: June 05, 2014, 02:01:34 AM »
Neither mouse buttons work for me in the compiled project.

Could you try iMouseButtonDown() instead of Click() in your project?

And could you try a new project with iMouseButtonClick() and compile it and check if it works?
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #5 on: June 05, 2014, 04:36:06 PM »
This mite be a stupid question but..  you are aware that you have to have the 3drad window focused and maybe even mouse over the window project for 3drad to capture the mouse click.

if your running full screen you'll also need to include a mouse sprite and mark it as "full screen mouse pointer" or you wont see a mouse cursor when full screen.

other wise, include the project and let us take a look see and maybe find a script issue you've missed.
« Reply #6 on: June 05, 2014, 05:05:15 PM »
Quote
Neither mouse buttons work for me in the compiled project.

Could you try iMouseButtonDown() instead of Click() in your project?

And could you try a new project with iMouseButtonClick() and compile it and check if it works?

The uploaded project already contains an iMouseButtonDown command (iMouseButtonDown(1)).

Also, I made a project containing an iMouseButton command, and that seemed to work fine.

I also took my problematic script and copy-pasted it into a new script object in a new project. I still had the same difficulties. Clearly there is something wrong with my script. Although I am still unsure why my project should work fine in the 3dRad editor, but differently in the compiled version.

Here's the problematic portion of my script. Perhaps someone can make sense of this all:

Code: [Select]
///----------------------------------------------------------CONTROLS - Weapons--------------------------------------------------------
float timer = 225;
dist = 70; //firing speed mps!!!

if ((finalrot > 60) && (finalrot < 100)) //final rot is the orientation of the camera relative to the orientation of the boat. The camera direction is used to decide which guns to fire.
   {
   weapon = "right";
   }
else if ((finalrot < -60) && (finalrot > -100))
   {
   weapon = "left";
   }
else if ((finalrot > 150) || (finalrot < -150))
   {
   weapon = "rear";
   }
else
   {
   weapon = "...";
   }

if (iMouseButtonDown(1)) ///AIM!
   {
   if (weapon == "left")
      {
         iObjectChildTransform(OBJ_0,OBJ_330,Vector3(0,0,0),aim[0]); //place and orientate the aiming skinmesh
         iObjectOrientationSet(OBJ_330,SHIPQY);
         iObjectShow(OBJ_330);
      }
   else if (weapon == "right")
      {
         iObjectChildTransform(OBJ_0,OBJ_330,Vector3(0,0,0),aim[1]); //place and orientate the aiming skinmesh
         iObjectOrientationSet(OBJ_330,SHIPQY);
         iObjectShow(OBJ_330);
      }
   else if (weapon == "rear")
      {
         iObjectChildTransform(OBJ_0,OBJ_330,Vector3(0,0,0),aim[2]); //place and orientate the aiming skinmesh
         iObjectOrientationSet(OBJ_330,SHIPQY);
         iObjectShow(OBJ_330);
      }
   else
      {
      iObjectHide(OBJ_330);
      }
   }
else
   {
   iObjectHide(OBJ_330);
   }
if (iMouseButtonClick(0)) ///FIRE!
   {
   if (weapon == "left")
      {
      if (left > timer)
       {
         for(n=0;n<4;n++)
         {
         rand = (iFloatRand(50,90))*0.1;
         iObjectChildTransform(OBJ_0,OBJ_286,Vector3(0,0,0),gun[n]);
         iObjectLocation(OBJ_286,cbloc);
         iObjectImposterSet(OBJ_220,n,Q,cbloc);
         iObjectImposterVelocitySet(OBJ_220,n,Vector3(L[0].x,rand,L[0].z));
         left = 0;
         }
         //----------smoke
                  iObjectChildTransform(OBJ_0,OBJ_242,Vector3(0,0,0),gun[0]);
                  iObjectOrientationSet(OBJ_242,SHIPQY);
                  iObjectStart(OBJ_242);
                  iObjectChildTransform(OBJ_0,OBJ_352,Vector3(0,0,0),gun[1]);
                  iObjectOrientationSet(OBJ_352,SHIPQY);
                  iObjectStart(OBJ_352);
                  iObjectChildTransform(OBJ_0,OBJ_374,Vector3(0,0,0),gun[2]);
                  iObjectOrientationSet(OBJ_374,SHIPQY);
                  iObjectStart(OBJ_374);
                  iObjectChildTransform(OBJ_0,OBJ_396,Vector3(0,0,0),gun[3]);
                  iObjectOrientationSet(OBJ_396,SHIPQY);
                  iObjectStart(OBJ_396);
         //-------------

       }
      }
   if (weapon == "right")
      {
      if (right > timer)
        {
         for(n=4;n<8;n++)
         {
         rand = (iFloatRand(50,90))*0.1;
         iObjectChildTransform(OBJ_0,OBJ_286,Vector3(0,0,0),gun[n]);
         iObjectLocation(OBJ_286,cbloc);
         iObjectImposterSet(OBJ_220,n,Q,cbloc);
         iObjectImposterVelocitySet(OBJ_220,n,Vector3(L[0].x,rand,L[0].z));
         right = 0;
         }
         //----------smoke
                  iObjectChildTransform(OBJ_0,OBJ_242,Vector3(0,0,0),gun[4]);
                  iObjectOrientationSet(OBJ_242,SHIPQY);
                  iObjectStart(OBJ_242);
                  iObjectChildTransform(OBJ_0,OBJ_352,Vector3(0,0,0),gun[5]);
                  iObjectOrientationSet(OBJ_352,SHIPQY);
                  iObjectStart(OBJ_352);
                  iObjectChildTransform(OBJ_0,OBJ_374,Vector3(0,0,0),gun[6]);
                  iObjectOrientationSet(OBJ_374,SHIPQY);
                  iObjectStart(OBJ_374);
                  iObjectChildTransform(OBJ_0,OBJ_396,Vector3(0,0,0),gun[7]);
                  iObjectOrientationSet(OBJ_396,SHIPQY);
                  iObjectStart(OBJ_396);
         //-------------

        }
      }
   if (weapon == "rear")
      {
      if (rear > timer)
       {
         for(n=8;n<10;n++)
         {
         rand = (iFloatRand(50,90))*0.1;
         iObjectChildTransform(OBJ_0,OBJ_286,Vector3(0,0,0),gun[n]);
         iObjectLocation(OBJ_286,cbloc);
         iObjectImposterSet(OBJ_220,n,Q,cbloc);
         iObjectImposterVelocitySet(OBJ_220,n,Vector3(L[0].x,rand,L[0].z));
         rear = 0;
         }
         //----------smoke
                  iObjectChildTransform(OBJ_0,OBJ_242,Vector3(0,0,0),gun[8]);
                  iObjectOrientationSet(OBJ_242,SHIPQY);
                  iObjectStart(OBJ_242);
                  iObjectChildTransform(OBJ_0,OBJ_352,Vector3(0,0,0),gun[9]);
                  iObjectOrientationSet(OBJ_352,SHIPQY);
                  iObjectStart(OBJ_352);
         //-------------

       }
      }
   }

for(CBI=0;CBI<10;CBI++)
   {
   iObjectImposterGet(OBJ_220,CBI,CBQ[CBI],CBL[CBI]); //get the location of each cannonball
   iObjectImposterSet(OBJ_198,CBI,CBQ[CBI],CBL[CBI]); //place some 'firey' particles there
   }
//this portion of the script (among other things) determines the vector for the iObjectImposterVecocitySet command for each cannonball. - it doesn't seem to be causing the problem.
iObjectLocationSet(OBJ_264,L[1]); //centre place
iObjectLocation(OBJ_308,L[2]); //aim get
L[0] = Vector3((L[2].x-L[1].x),0,(L[2].z-L[1].z));
iQuaternionFromEulerAngles(SHIPQY,0,Rot.y,0,"xyz");
iObjectOrientationSet(OBJ_264,SHIPQY);
iObjectChildTransform(OBJ_264,OBJ_308,Vector3(0,0,0),Vector3(0,0,dist));
left++;
right++;
rear++;
}

Just to reiterate. This script works fine in the editor. And I can use iMouseButton commands in other compiled projects. It is just the iMouse commands in this particular script, which don't work in compiled projects.

Anyway, thanks so much for the suggestions. I appreciate your guys help.

I should mention that there is one thing I have not tried. I might attempt to remove the problematic portion of my script and re-do it in another script object. Perhaps that would set things straight.

Cheers,

G
« Reply #7 on: June 05, 2014, 05:17:37 PM »
This mite be a stupid question but..  you are aware that you have to have the 3drad window focused and maybe even mouse over the window project for 3drad to capture the mouse click.

if your running full screen you'll also need to include a mouse sprite and mark it as "full screen mouse pointer" or you wont see a mouse cursor when full screen.

other wise, include the project and let us take a look see and maybe find a script issue you've missed.

I just had a go now with a "full screen mouse pointer" sprite. Thanks for the suggestion, but I still had no luck.

I don't really want to post a link to my project here. But if anyone (who is trustworthy  :P) would like to take a look and see what's wrong, just PM me and I'll send a mediafire link (or similar) containing a compiled project (which includes the non-standard 3d rad resources) and a .3dr.
« Reply #8 on: June 05, 2014, 05:43:08 PM »
Without seeing your project, and i'm not really interested in debugging your project..

I  suspect as you do  it's not the mousebutton functions that have an issue but the script parts they control..

Debug debug.. and have fun.. :P
« Reply #9 on: June 05, 2014, 05:50:10 PM »
oh and to your comment ,..

I too have had a project or two run differently between editor and compiled versions.. it's very annoying and off hand i cant say what the issue is in that problem.. and i cant right at this moment remember what differences i had when it happened.

It's just another "issue" to add to 3drads list of fun things we need to deal with.
 
« Reply #10 on: June 05, 2014, 05:58:39 PM »
downloading it now... will take a look in a few minutes...

--Mike
« Reply #11 on: June 05, 2014, 07:04:28 PM »
G... did you try substituting  key inputs for the mouse down and mouse clicks....

just to verify that the problem is the mouse events... and not in the logic...


also... but not related to the issue at hand,

great looking water... looks much smoother than my animated water...  and the island reflections look great...

the ship moves very smoothly... i ran it up onto the island   ;D ;D


still looking

« Reply #12 on: June 05, 2014, 07:28:22 PM »
Well, this is embarrassing...

The problem is fixed now. Turns out that the compiled project didn't contain the Radmath .dll's which I was using in my project. I added them to the script object folder in the compiled project and voila! Everything works perfectly.

Anyway, thanks to everyone who took a look at this.

Attached is a .rar file. Unzip it and merge the 3DRad_res folder inside with the one in my compiled project. Happy shooting!
« Reply #13 on: June 05, 2014, 07:31:54 PM »
ROTFLMAO  ;D  ;D  ;D

don't ya just hate it when that happens...   :D

what's even more embarrassing (to me) is that i didn't catch that when i looked at the files in the folder...

that's the way it goes much of the time...  something incredibly simple   ;D

--Mike
« Reply #14 on: June 05, 2014, 07:43:00 PM »
ROTFLMAO  ;D  ;D  ;D

don't ya just hate it when that happens...   :D

what's even more embarrassing (to me) is that i didn't catch that when i looked at the files in the folder...

that's the way it goes much of the time...  something incredibly simple   ;D

--Mike

Yea... whoops  ;D At least I now know that I have to manually add non-standard .dll's to the compiled project. The more you know etc, etc...

Also:

Quote
great looking water... looks much smoother than my animated water...  and the island reflections look great...

the ship moves very smoothly... i ran it up onto the island   ;D ;D

Thanks, and haha yea... ignore that second thing. I'll fix that later  :P

Cheers,

G
Pages: [1] 2