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]

Author Topic: Keyboard config  (Read 159 times)

« on: November 26, 2013, 12:23:05 PM »
It is just me or my system ?

I was playing around with the projectile and configured a oneshot key press in script ( i've used may time before).

Using the [ENTER] key to fire the projectile..

Code: [Select]
bool bp;

///               
void Main()
{
   ///Button Press
  ///   `DIK_ENTER` wont work, use `DIK_RETURN` instead.
   if (iKeyDown(iKeyCode("DIK_ENTER")) && !bp ){
      bp = true;
      iObjectStart(OBJ_66);  ///fire projectile
   }else{
      bp = false;
   }
}

Stupid code wouldn't work !!

I added the configure controls & a EventOnInput.

The EOI object, set to the [ENTER] key, works fine.

The configure controls utility registers the enter key as [ENTER].

I wasted 2 days trying to figure out why my key input script above wouldn't work.

Then it downed on me..

It's not [ENTER], it's [RETURN]... %^#*$)@#)&

Is this just my system ? or is this a `issue' with the configure controls utility, where it should really show [RETURN] as the key press... IMO... not [ENTER]. or maybe [ENTER]/[RETURN] :P .

Maybe it's an age thing catching up to me, and not using 3drad a whole lot till recently thinking up a project idea, and throwing it together.

PS Not a FPS, even though it will have 6 projectiles in it, for a 6 players, multi-user project :P .

You have already seen some screen shots .. WIP.
« Reply #1 on: November 26, 2013, 02:12:44 PM »
Yep, 'return' is the way to go. 'enter' doesn't work for me either.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #2 on: November 26, 2013, 02:31:20 PM »
According to the DIK code list, RETURN is the word used for both enter keys (the main one and the one on the number pad).  DIK_ENTER is not a valid DIK code which explains why your code wouldn't work.  I learned that one the hard way too, but when my code didn't work the first thing I thought of was to check the DIK code and sure enough, once I changed that, it all worked like it was supposed to.
Pages: [1]