The Big Question to all UnrealScript programmers

Discussions about Coding and Scripting
Post Reply
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

The Big Question to all UnrealScript programmers

Post by Feralidragon »

Maybe now I might catch your attention to my issues...

Objective: Build some player controlled vehicles with a wide range of controls.

Strategy: Use the exec functions to control the vehicle if possible.

Problem: I am a noob at UnrealScript programming, and I am not on my PC, so I can't try this:
if I create a subclass of Actor, and when this actor is owned by the player, does this next function react to players input actions?
exec function Fire( optional byte F)
{
//My Code here
}
Why this? If this works, I could build a very good vehicle. :mrgreen:

If not, how do I make an actor to react to certain player's inputs, like Jump, StrafeLeft and so?
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

Re: The Big Question to all UnrealScript programmers

Post by Shadow »

For this simple task you only need to cast the viewrotation of the current player to the actor. Further movement magickal controlled through player (moving by basic keys) is possible of course.
They way I would do it, and doing currently for the SDK:
- a class, that if touched or entered or whatever that can be controlled by that touch/enter-event caused player
- the class then has a reference to that player which it may use for possessed movement
- defining a key for leaving
- getting state information of the player to receive data what he's doing right now (for example: IsInState('StateName'))

Another method would be to let a pawn be possessed by the player, there're a couple of functions for that matter.
the exec function Fire pasted into YOUR class won't work, exec functions only work for direct player input, as said before you need to gather information when the player is doing this, preferably without coding a new player class
Image
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: The Big Question to all UnrealScript programmers

Post by Feralidragon »

Thank you :tu:

But, I know that ViewRotation stuff, and it will be used for flying vehicles, and I want to make terrain vehicles too, where these vehicles turn by pressing the strafe controls (StrafeLeft and StrafeRight), like ut2004.
And the only variable I know to know if the player is strafing is bStrafe, but I don't know to which side is he strafing.
For other hand, I can't find any variable to know if the player is jumping (for flying vehicles), I do not find any bJump or another reference to jumping, and those are my issues, so I thought in the exec functions, where the player inputs his actions. But that doesn't work, as you said...

Do you know how I know what the player is trying to do, like jumping or strafe to a certain direction (I have looked into to the Pawn's and PlayerPawn's scripts, and no success). :noidea
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

Re: The Big Question to all UnrealScript programmers

Post by Shadow »

For a UScript Beginner coding straight-forward Vehicles isn't a good decision, it's not simply that reading out information of the player, still replication code frightens me to death :ironic2:
Image
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: The Big Question to all UnrealScript programmers

Post by Feralidragon »

Yeah, I just understand Replication about 5%, like what has to be simulated, what's not, some basic replication functions, but nothing more (I know just to made custom weapons playable online, if they aren't complex).

But I need really to make my own vehicles to my SP Mod, and these last days I have figured out major things about player's inputs, other's vehicles scripts and stuff.

And I just need to know when the player jumps and when the player strafes (to which direction: left or right), and don't know if bStrafe tell us to which side is the player strafing. :noidea

All the other things vehicle related, I know to perform and program, but these 2 commands are the "black sheep".

:help: :help: :help:


EDIT: I just have taken a look to playerpawn's code, to know his inputs variables, and maybe i found how do I know what is he doing :mrgreen:
I think maybe are the bool variables such:

bWasRight (True when aStrafe < 0)
bWasLeft (True when aStrafe > 0)
bPressedJump (True when the player jumps)


What do you think? Maybe I am not such noob I thought I was :tongue: , just kidding, I am still a noob, but what's your opinion?
User avatar
-Feint-
Skilled
Posts: 175
Joined: Sat Mar 08, 2008 1:39 pm
Personal rank: Amateur Mapper
Location: UK - Leeds

Re: The Big Question to all UnrealScript programmers

Post by -Feint- »

Testaccount wrote:Slightly off topic - if youre after a simple remote actor pawn to create try making a sliding move fixed on a "rail" with an attached turret.

Bind strafeleft/right to strafe the platform, and bind fire to shoot the turret. Space invaders style. :?: Ah dunno, just an idea, perhaps it might help you understand how the coding works without going too far into replication.
Its easier to replicate 3 things instead of 8.
DanomanUK@i4games-Forum wrote:Nah, people bitch one way or another.
You cant win as a mapper ;)
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: The Big Question to all UnrealScript programmers

Post by Feralidragon »

-K¡ngS- wrote:Slightly off topic - if youre after a simple remote actor pawn to create try making a sliding move fixed on a "rail" with an attached turret.

Bind strafeleft/right to strafe the platform, and bind fire to shoot the turret. Space invaders style. :?: Ah dunno, just an idea, perhaps it might help you understand how the coding works without going too far into replication.
Its easier to replicate 3 things instead of 8.
You gave me a good ideia to a type of turret/defense :gj:

But my point here is not to make a sliding turret, as your ideia is very good. My point is to make a "real" terrain vehicle like a tank, which I know how to simulate the physics well, but my problem are the controls :help:

But I figured out (I guess) how to do it, using some boolean playerpawn variables, but I didn't tried that yet.

But one question Kings: How do I do that? The pawn's and binding things?

P.S.: I am not concerned about replication yet :wink: , it's for offline use for now.
User avatar
-Feint-
Skilled
Posts: 175
Joined: Sat Mar 08, 2008 1:39 pm
Personal rank: Amateur Mapper
Location: UK - Leeds

Re: The Big Question to all UnrealScript programmers

Post by -Feint- »

Testaccount wrote:Whoooa there nelly! :loool: I know less than you. Hahaha.
I get the ideas not implement them :lol: Sorry I can't be of much more help. :?
DanomanUK@i4games-Forum wrote:Nah, people bitch one way or another.
You cant win as a mapper ;)
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: The Big Question to all UnrealScript programmers

Post by Feralidragon »

-K¡ngS- wrote:Whoooa there nelly! :loool: I know less than you. Hahaha.
I get the ideas not implement them :lol: Sorry I can't be of much more help. :?
Don't worry, you helped much, you gave me an ideia to put on my Mod too :tu:
Besides, maybe I just found a way to do it, like I said. :rock:

I am just waiting for Shadow's opinion about the playerpawn's boolean variables such bWasLeft, bWasRight and bPressedJump...
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: The Big Question to all UnrealScript programmers

Post by Feralidragon »

Help?

:help: :help: :help: :help: :help: :help: :help: :help:
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: The Big Question to all UnrealScript programmers

Post by Feralidragon »

Feralidragon wrote:I just have taken a look to playerpawn's code, to know his inputs variables, and maybe i found how do I know what is he doing :mrgreen:
I think maybe are the bool variables such:

bWasRight (True when aStrafe < 0)
bWasLeft (True when aStrafe > 0)
bPressedJump (True when the player jumps)
Well, any ideias, does the "bWasRight" and "bWasLeft" stuff tell you something???

:help: :help: :help: :help: :help:

(I didn't even tried, I want to know maybe a better way to do this, so..., before I start to build a new class)
Myth
Inhuman
Posts: 988
Joined: Tue Feb 12, 2008 5:57 pm
Personal rank: Low Poly Freak

Re: The Big Question to all UnrealScript programmers

Post by Myth »

I am certain that those are boolean variables.
And I think they tell whether a key was pressed since the last tick or frame or step or something.

Fairly good for a non UnrealScript programmer, no?
User avatar
[JAG]Teabag
Skilled
Posts: 177
Joined: Wed Oct 01, 2008 9:18 pm
Personal rank: Clan Server Admin
Contact:

Re: The Big Question to all UnrealScript programmers

Post by [JAG]Teabag »

not sure if the reply will help but check out BullDozers web pages found at http://www.bulldozer.utjag.co.uk/Mainpage.htm he writes many tutorials what your after may be there... :rock:
..Image
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: The Big Question to all UnrealScript programmers

Post by Feralidragon »

Good site, but I already have a full set of vehicles for UT99 done. I didn't code them, Dots (.:..:) coded them, but I will add my fixes and addons.

But thanks anyway :tu:
Post Reply