Help with your scripting

Scripted Character Setup

Scripted Character Setup

Postby planetX » 13 Jun 2018, 13:09

Hi there,

I'm working on a character setup and I'm trying to implement a simple climbing action. I want the capsule getting stuck in the wall to simulate the first step in the process, which is the hanging. I've tried some things but the capsule is always affected by physics. Is there any way to just stop the capsule at a certain point?

I've used the "Character_Player_Melee.lua" script as a starting point.

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Scripted Character Setup

Postby SolarPortal » 13 Jun 2018, 13:29

you can use the set controller.setMoveAdvanced() and controller.setMoveDirection() to overwrite movement controls on a character capsule. This is for spawned controller, for SCC, use the character library()

There is also a controller.moveUp() command.

Then you could also try using the controller.enableGravity() or controller.setGravity() commands too if the previous ones dont do it.
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Scripted Character Setup

Postby planetX » 13 Jun 2018, 14:01

setMoveAdvanced and setMoveDirection work like a charm. :D

Thanks

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Scripted Character Setup

Postby planetX » 19 Jun 2018, 19:10

So I made some progress on this scripted character thingee... took me a while to understand how the controller functions work, but I think I more or less have it. Still needs a lot of work, but it is starting to behave like a character.

As I said before, I've started from the example script that comes with the engine. I've deleted all the attaking stuff and sounds and tried to simplify a bit. Also removed all the dynamic properties as I don't really need them at the moment. Then I've splitted the script in some parts to manage it better and made my own functions. Well, I've just discovered the multi timer function and I love it! :D I could synchronize the footsteps with the animation and the jumping stages. Just need some good sounds and animations.

Another big feature is the state machine I've implemented. Each movement has its own state, and some movements have more than one state, ie. the ladder climbing action has four:

CLIMB_LADDER_START
CLIMB_LADDER_IDLE
CLIMB_LADDER_MOVE
CLIMB_LADDER_END

By separating the states I can define what the character does on each one, which makes everything easier, although I'm still dealing with some overlapping booleans between states. The character has tree raycasts to detect the ladders, the ledges and the distance to the ground. Here some shots:






My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Scripted Character Setup

Postby SolarPortal » 19 Jun 2018, 20:37

Very impressive! You got the hang of that pretty quickly.. haha sorry! :lol:

It would be awesome if you wrote some of these techniques of yours up into tutorials for users as you have made some really good mechanics.

I'm looking forward to seeing where this one leads too... so many projects of yours to keep tabs on now :shock:

Multi Timers are an essential part of skyline and pretty easy to use :) Game states are very powerful and skyline does have a built in state set which are more game side related(Main game, pause, game over etc...), but great to see what you have done with yours. Qt plugins for skyline could be a useful addition to your state sets for controlling bits too :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Scripted Character Setup

Postby StarFire » 19 Jun 2018, 20:40

omg! :shock:

You have done it again! Awesome work :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Scripted Character Setup

Postby planetX » 20 Jun 2018, 12:45

Thanks guys, glad you like it. ;)

Hmm, tutorials... exactly what I need!! :lol: jk, maybe some day, I'm still learning things and most of my demos are just experiments, I feel myself too "green" for that, but I'll consider it. :)

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Contributor
Skyline Contributor
 
Posts: 210
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 3 guests

cron