First. Problem I faced after making a block is I dont know how to click the block to receive quest.
This forum is now archived!
- Welcome to the archive!
News:
The 3DRad community can be found at classdev.net.
- 3D Rad - Free 3D game maker - Forum >
- General Category >
- 3D Rad - Optimization Tips >
- Want to make action/strategy action role playing games. Help
Author Topic: Want to make action/strategy action role playing games. Help (Read 686 times)
If you used a skinmesh, there is a little checkbox in the properties window that says 'Detect Mouseover Event'. You can use this in a script to check if you have clicked the box, and if you have you can open a quest dialog box or whatever you want the game to do from there.
If your skinmesh object is OBJ_0, then the mouseover flag is IN_3 (you can see what it is in the INPUT box of the script dialog.
so the script would be:
if (IN_3 > 0) // check if the mouse is over the skinmesh
{
// if it is, do stuff
}
you could also say:
if (IN_3 > 0 && iMouseButtonClick(0)) // checks if the mouse is over the skinmesh AND if you left-clickedd
{
// if both are true, do stuff
}
so the script would be:
if (IN_3 > 0) // check if the mouse is over the skinmesh
{
// if it is, do stuff
}
you could also say:
if (IN_3 > 0 && iMouseButtonClick(0)) // checks if the mouse is over the skinmesh AND if you left-clickedd
{
// if both are true, do stuff
}
I added terrain car skinmesh g force script. In script
void Main()
{
if(IN_69 > 0)
iObjectHide(OBJ_0);
}
Car did not vanish
void Main()
{
if(IN_69 > 0)
iObjectHide(OBJ_0);
}
Car did not vanish
Quote
First. Problem I faced after making a block is I dont know how to click the block to receive quest.
a block to receive a quest???
exactly what are you asking here... what exactly is this QUEST you are referring to...
--Mike
I know this is not easy. Butt in a simple priject after I did what I wrote in the previous post the skinmesh did not vanish when I put the cursor over the skinmesh. How to get mouse over flag worked?
Quote
the skinmesh did not vanish when I put the cursor over the skinmesh. How to get mouse over flag worked?
ok... that's a lot better... at least i know what you're trying to do now...
the mouse over flag for is skinmesh must be enabled in the properties dialog box, and then a lil simple logic will let you do whatever you want... in your case, hiding the mesh...
the logic looks like this: if mouse over then hide mesh...
the script code looks like this:
Code: [Select]
if(IN_3>0)iObjectHide(OBJ_0);
(if the skinmesh is OBJ_0)...
you realize though, that this will only occur once, because once you hide the mesh the mouseover can no longer "see" it...
if you need to toggle back and forth between visible and hidden, then i'd suggest you link a sprite to the screen location of the mesh... set the sprite opacity to 0.01 (something just above invisible, the mouse over can still see it but the viewer can't), and use that as the mouse over target instead...
then use the same logic as above... this time the mouseover over the sprite will determine the visibility of the mesh...
look at i3DLocationToScreen() in the script reference for how to keep the sprite positioned...
Code: [Select]
Vector3 v1,v2;
void Main()
{
iObjectShow(OBJ_0);
iObjectLocation(OBJ_0,v2);
i3DLocationToScreen(v1,v2,OBJ_44);
iObjectLocationSet(OBJ_22,v1);
if(IN_23>0)iObjectHide(OBJ_0);
}
--Mike
Just thought I'd point out that you can make a toggle system within the script like so:
if (IN_3 > 0) { iObjectHide(OBJ_0); }
else { iObjectShow(OBJ_0); }
if (IN_3 > 0) { iObjectHide(OBJ_0); }
else { iObjectShow(OBJ_0); }
Quote
Posted by: Sorvius
Insert Quote
Just thought I'd point out that you can make a toggle system within the script like so:
if (IN_3 > 0) { iObjectHide(OBJ_0); }
else { iObjectShow(OBJ_0); }
question...
did ya try that lil bit o code above before you decided to make your point (whatever that point might be)...
anyways, here's a point you might wanna consider... no, never mind... lets see if you can figure it out yourself why your code DOESN'T WORK...
1 - put a mesh in a scene, add a script, link the mesh, paste that code in there, and run it...
2 - what are the results that you get...
do you see the value of basing your code on sound logic... and what happens when you don't THINK FIRST...
here's a few points ya might consider...
bad logic = bad code...
no logic = insanity...
--Mike
Pages: [1]