Some help with UnrealScript constraint.

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Firewind

New Member
May 4, 2006
15
0
0
Hi all,

I'm currently experimenting with a piece of code which has a constraint on it so when your in the environment, you have to press 'P' on the keyboard before the script activates.

The problem is, I don't want this to happen. I just want to remove the constraint so P is not required to be activated when the world starts.

I'm not that great at Unrealscript. I just wondered if someone could point out which part of the code that needs to be taken out to delete the constraint?

I've attached the code, I'd be greatful if someone could point out the area which needs attention.

Regards,

Firewind.
 

Attachments

  • ClickInteraction.txt
    5.3 KB · Views: 13

pospi

New Member
Jun 30, 2003
298
0
0
www.pospi.cjb.net
the easiest thing to do might be to take the KeyEvent() function and move the stuff that happens when you press 'P' to PostBeginPlay()
 

Firewind

New Member
May 4, 2006
15
0
0
Thanks Popsi,

Someone was helping me with this and they said that a boolean function just needs to be turned back to 'false' to stop the constraint from working, problem is, I don't really know what I'm looking for.
 

techbinge

New Member
Jan 16, 2006
26
0
0
San Diego
So the idea is paint some texture when the left mouse is held down correct? Somwhere you are going to need a constraint so that the user must be doing something before the texture can be painted. IE, if the user is holding down the left mouse button paint this texture to the canvas.

So first off, maybe you can clarify a little more on what you want this all to do?

The only bool in your code that is toggleing is the bIsPainting, on line 4 below:

Code:
//Toggle painting mode
		case IK_P:
			if (Action == IST_Release) {
				bIsPainting = !bIsPainting;

				if (bIsPainting) {
					myPaintBrushLocator = Self.ViewportOwner.Actor.Spawn (class'IVES2L9_PaintBrushLocator', Self.ViewportOwner.Actor, 'left', vLastPaintPos, rotator(vLastPaintNormal));
				}
				else {
					//txtCurPaintBrush = none;
					myPaintBrushLocator.Destroy ();
				}
			}

So if you want to user to hold down the left click mouse and then paint, just look at the case below the one I posted. It would go something like this:

Code:
case IK_LeftMouse:
			if (Action == IST_Press || Action == IST_Hold) {
                        //insert some code for when the mouse is held down
			}

Hopefully some of this makes sense. Again, you're just going to need to setup a function to be run when the user holds down the left mouse. It looks like most of the code to actually 'paint' a texture is is almost done. Keep at it!

-tyler