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 3 [4] 5 6

Author Topic: Script related questions  (Read 8112 times)

« Reply #45 on: September 25, 2013, 09:00:53 AM »
Sorry for frustrating you. I have no internet on my :'( computer. I am posting by mobile.
« Reply #46 on: October 01, 2013, 05:53:56 AM »
What do I write when in if statement there are two conditions, think I have to jump and then I have to dash. After these two conditions I have to hide.
Should I put comma(,) between the two conditions and then put these two conditions on then brackets after if?
« Reply #47 on: October 02, 2013, 05:40:23 AM »
A multiple if-statment looks like this:

if (condition)
{
   Action1;
   Action2;
   etc.
}
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #48 on: October 02, 2013, 06:06:09 AM »
Oh, I meant the action should not be two. But. The conditions should be two.
Should it be like:-

if (condition1, condition2)
{ Action;
}

Sorry for I did not clearify that before.
« Reply #49 on: October 02, 2013, 06:13:33 AM »
What if the conditions are sequential, not simultaneously. Is there any then function?
« Reply #50 on: October 02, 2013, 08:07:17 AM »
if(this OR that)

or

if(this AND that)

is that what you're asking...

--Mike
« Reply #51 on: October 02, 2013, 08:29:06 AM »
Yep, what Mike said.

if (condition1 && condition2) Action; //And

if (condition1 || condition2) Action; //Or

Keep in mind you can use '()' to create priorities.
This...
if (condition1 || conditon2 && condtion3 || condtion4) Action;
...Is not the same as...
if ((condition1 || conditon2) && (condtion3 || condtion4)) Action;
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #52 on: October 02, 2013, 02:29:06 PM »
What a brilliance.
For car
If (jump) and (jump and dash)
Action hide;
Will that work?
I am thinking if the script can be written in loop. If so, can you tell me how?
« Reply #53 on: October 03, 2013, 01:44:57 PM »
What should I write not to immediately hide when I just press dash. But after some time when I press dash it disappears. So that I can see the dash before disappearing.
« Reply #54 on: October 04, 2013, 04:26:47 AM »
If (jump) and (jump and dash) Action hide;

It isn't necessary to add jump twice. This should work:

if (jump && dash) ActionHide;

And you won't need any loops.

What should I write not to immediately hide when I just press dash. But after some time when I press dash it disappears. So that I can see the dash before disappearing.

Try something like the following:

float timer = -1;
void Main()
{
   if (jump && dash) //If jump and dash...
   {
      if (timer = -1) timer = 0; //Set Timer from inactive (-1) to active (0), but just once, otherwise the timer won't work.
   }

   if (timer > -1) timer += 0.016667; //If timer is active, start counting by approximately 1/60 of a second.

   if (timer > x) //When you've waited long enough...
   {
      iObjectHide(OBJ_x); //Do your stuff.
      timer = -1; //Set timer back to inactive.
   }


That should do it.
« Last Edit: October 09, 2013, 08:40:12 AM by RobertooMolvadoo »
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #55 on: October 08, 2013, 04:55:17 AM »
I am worried how I will make scripts on later parts of my game even I can not comprehend the script that I have written in past. If I add jump twice, will the program take the result once to avoid what is written on process or examine first part to execute and then second part?
« Reply #56 on: October 09, 2013, 08:42:43 AM »
I have clue what your actual question is.

A little tip, not at all meant offensive in any way, don't try to sound smart. It's unnecessary and just makes you less comprehensible.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #57 on: October 09, 2013, 09:16:50 AM »
Ohh,sorry. Many things to tell and I cant see small things well. On a post I accidentally read is instead of isn't. So I got whole thing wrong
« Reply #58 on: October 10, 2013, 10:38:50 AM »
Quote
don't try to sound smart. It's unnecessary and just makes you less comprehensible.
that's some good advice...  probably why nothing i say makes any sense ay all...
 ;D  ;D

--Mike
« Reply #59 on: October 11, 2013, 07:42:36 AM »
I wrote
float timer = -1;
void Main()
{
if (iObjectStart(OBJ_0))

}

if (timer = -1) timer = 0;
{
if (timer > -1) timer += 0.016667;

if (timer > .5)
{
iObjectHide(OBJ_66);
timer = -1;
}
force inputed, targeted and ignored script three times.
No work
Pages: 1 2 3 [4] 5 6