This is a test. Test! Consider yourself tested.

UScript: Chat, Questions, Discussion

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar ividyon
Administrator Administrator
Posts: 2352
Joined: 12 Nov 2007, 14:43
Location: Germany
Contact:

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 30 Oct 2013, 20:25

Stickied, because UScript will remain a topic of hot discussion for a loooong time!

EDIT: Woops, I opened a new page... xRedStar's problem on the previous page remains unanswered, by the way.
UnrealSP.org webmaster & administrator

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 31 Oct 2013, 02:05

xRedStar wrote:I'm working on some AI Code lately, and I wanted to make smarter and tougher SkaarjOfficers that can strafe with shield up and also have regenerating shield belts if untouched by enemy fire. So in this situation I had an idea for them to find cover and in this process I sort of got mixed up in ideas of how this could work.

One of the ideas was to tell the AI to set random locations to move to until it finds a location that cannot be seen by the enemy. So basically, it iterates an algorithm that checks to see if the randomly picked location - enemy.location takes more than a single vector to be reached. As long as the Enemy isn't directly in the line of sight, it would be considered cover. On the other hand, once the AI reaches the location I want to try and measure the wall size to see if the AI is taller than the wall... and if he is then play function crouching() etc etc... in this case I was wondering if I could actually condition the amount of vectors it takes for the enemy to see the location of cover. And if I could measure the wall height to tell the AI to crouch, I also know that there is a LineofSight variable but IDK what it really does.


This sounds really interesting and I'd be interested to see how you set it up. Basically it sounds like you want to do a bunch of trace checks, or maybe fasttrace if you only want to count geometry as cover (otherwise things like plants or barrels or even projectiles could count as cover if they manage to be in the way at just the right moment).
Image

xRedStar
Skaarj Assassin Skaarj Assassin
Posts: 122
Joined: 13 Jan 2013, 18:56

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 03 Dec 2013, 21:20

Does anybody else struggle to understand what variables do what, since Unreal has tons of variables in just Actor and below. I understand basic variables that are used in the game often, Health... Collision... GroundSpeed... AirSpeed... Acceleration... but what about complex variables like. Movement variables, or Mouse Coordinates and if there is anything like Mouse Vectors to work with. I looked at Pawn and PlayerPawn and I see... aMouseX, aMouseY, MouseSpeed... it just goes on and on but I can never truly figure out what variable is directly controlled by the users hardware. Or even the Keyboard, are there any specific variables for conditioning whatever the keyboard and mouse controls. I looked deep for Input Variables and stuff but never found anything that noticeable yet.

As a novice programmer, I make things all the time and test myself and my memory to put together simple mods. But never have I got any deeper than Game Info and changing some basic variables that make weapons more fun to use. But let's say for instance I am currently working on a strafe jumping mod for Unreal, I have found a few important functions and events to override. DoJump(), Landed() I think are two really good ones. But let's say I want to go deeper in how the Air Acceleration works, something more like Quake where you add acceleration to your forward velocity by adding acceleration from your left and your right together. This might be something like VSize(MouseVectA + MouseVectB), but I don't know exactly to be honest. But the issue is knowing what variables to access and if they even exist for me. It's fairly difficult to believe this is impossible to do, because I've already accomplished a very watered down strafe jumping mod just a few weeks ago. Any suggestions guys?

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 04 Dec 2013, 00:57

I really doubt you'll ever be able to access I/O stuff with a higher-level scripting language like UnrealScript. That is definitely native C++ territory, which we don't have access to (unless you're a 227 developer, perhaps).
Image

xRedStar
Skaarj Assassin Skaarj Assassin
Posts: 122
Joined: 13 Jan 2013, 18:56

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 04 Dec 2013, 23:40

In the UDK they have a PlayerController class that holds the functionality of the Mouse coordinates and the speed or if it is moving up down or left or right. However in Unreal so far there is only the value of which way it goes and whether it has mouse smoothing enabled. I'd almost find it hard to believe the basic Mouse Coordinate vectors are only held by the Native Code itself... but if this is indeed true. Then I feel sad!!! :(

However, there is a possible exception to all of this. Without using mouse coordinates and stuff there are still a few other ways I can still do this, but only based on how you start your jump and then I could store the old Acceleration into a variable and add to it every time a new jump occurs. This may be as close as I can get to Strafe Jumping, but on the other hand. Is it possible to just use the rotation and movement vectors of the PlayerPawn object itself as a measurement for Strafe Jumping instead of overriding Mouse and Keybaord crap?

If this is possible, then Strafe Jumping may also be possible to some degree. The only other thing I would need to know is if there are any variables that hold the direction the PlayerPawn moves. Not just XYZ but Variables like Forward, Backward, Left, Right. If there is any clue to what those are in the PlayerPawn movement, there is still a chance for my mod to be successful.

Bleeder91<NL>
Skaarj Assassin Skaarj Assassin
Posts: 147
Joined: 24 Jun 2011, 18:45

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 05 Dec 2013, 19:52

If by strafe jumping you mean adding velocity to each jump, try adding velocity directed to where the player is facing to:
vector(ViewRotation)*10

as for (mouse)movement:
aBaseX, aBaseY, aBaseZ, aMouseX, aMouseY, aForward, aTurn, aStrafe, aUp, aLookUp;

you could put a ClientMessage somewhere that tells when what is used and to what value it changes. Check PlayerPawn.PlayerWalking.PlayerMove(float DeltaTime) to see how they're used.
(class.state.function)

Hope that helps.

xRedStar
Skaarj Assassin Skaarj Assassin
Posts: 122
Joined: 13 Jan 2013, 18:56

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 05 Dec 2013, 21:03

ah it would be convenient to log the variables... i'll take that into consideration. also thanks, i'm going to have some fun figuring this out lol

Bleeder91<NL>
Skaarj Assassin Skaarj Assassin
Posts: 147
Joined: 24 Jun 2011, 18:45

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 15 Dec 2013, 20:13

So I've got a mutator that gives armor to Scriptedpawns randomly without setting them to bIsPlayer (damage is reduced via gamerules). Now I want to show their armor in the HUD, but online it either:
- Doesn't return anything when I use ScriptedPawn(Other).FindInventoryType(class'Armor');
- Returns a default armor when I use ForEach AllActors(class'Armor', A) if(A.Owner==ScriptedPawn(Other)) break;

Since I don't have any spare time these days, can anyone find a way way to fix this?

xRedStar
Skaarj Assassin Skaarj Assassin
Posts: 122
Joined: 13 Jan 2013, 18:56

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 15 Dec 2013, 21:49

May have to do a ForEach AllActors in the case of finding the Inventory Type... because it may not have any reference to the game.level. I'm sure you'll probably figure it out on no time though...

You should be able to search the Level.PawnList for your class and then check for his inventory.

Bleeder91<NL>
Skaarj Assassin Skaarj Assassin
Posts: 147
Joined: 24 Jun 2011, 18:45

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 15 Dec 2013, 22:22

I did foreach in the hud to find the pawn, which works fine. findinventorytype Works offline, but returns None online. if i use a foreach to gind the armor that has the pawn as owner IT Works offline (Nyleve.Armor0) but online IT returns Nyleve.Armor... weird stuff.

p.s. my phone likes to throw in random capital letters.

xRedStar
Skaarj Assassin Skaarj Assassin
Posts: 122
Joined: 13 Jan 2013, 18:56

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 15 Dec 2013, 22:40

Yeah that is pretty weird, of course it could just be the way Epic programmed it. Maybe the answer lies somewhere within PlayerPawn or UnrealIPlayer... since they can hold inventory.

xRedStar
Skaarj Assassin Skaarj Assassin
Posts: 122
Joined: 13 Jan 2013, 18:56

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 16 Dec 2013, 00:30

Maybe it has something to do with the NetMode or whatever that is... like maybe the information is being retrieved from the wrong place resulting with no list.

xRedStar
Skaarj Assassin Skaarj Assassin
Posts: 122
Joined: 13 Jan 2013, 18:56

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 16 Dec 2013, 09:17

I have one little question, what variable is the actual current speed of the player as he moves. This is one of the last things I need to know before I throw a video up of my mod :)

I need to be able to reset the angle based upon him stopping or slowing down too much.

Bleeder91<NL>
Skaarj Assassin Skaarj Assassin
Posts: 147
Joined: 24 Jun 2011, 18:45

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 16 Dec 2013, 18:51

xRedStar wrote:I have one little question, what variable is the actual current speed of the player as he moves. This is one of the last things I need to know before I throw a video up of my mod :)

I need to be able to reset the angle based upon him stopping or slowing down too much.


VSize(Velocity) should do fine, if you don't want any jumping in it (so only horizontal movement speed) use VSize(Velocity*vect(1,1,0))

As for my issue, solved by Dots. Gave the pawns a playerreplicationinfo that holds the armor value.
Last edited by Bleeder91<NL> on 16 Dec 2013, 19:13, edited 1 time in total.

xRedStar
Skaarj Assassin Skaarj Assassin
Posts: 122
Joined: 13 Jan 2013, 18:56

Subject: Re: UScript: Chat, Questions, Discussion

Post Posted: 16 Dec 2013, 19:01

Yep, that's what I wanted... and originally I was trying to figure out how to measure Velocity... but it always did something strange to his movement. So if this works, I can make sure the angles in which are taken will be reset if the player gets below the maximum running speed. Anyways thanks much, I'm making a video today!

Previous Next

Who is online

Users browsing this forum: No registered users and 35 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited