Scripts / Moving Objects With Physics?

Author
Message
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 6th Dec 2014 21:06
Hey everyone I've made some custom characters that arnt entire human shaped. I've been using the move forward and move backward commands to make them move around the terrain but I have discovered this doesn't seem to work correctly with objects with "physics" turned on. So I turned them off and they are able to walk around okay... but they go through other objects and float if they happen to go up a hill and walk off it.

How can I go about fixing this?

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 6th Dec 2014 21:22
try

turn gravity off
move them
turn gravity on

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 6th Dec 2014 21:38 Edited at: 6th Dec 2014 21:49
That should solve the issue of them floating. Though, how do I prevent them from passing through objects and buildings?



I'm wondering how the enemy stock characters get away with moving and using physics.

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
tomjscott
User Banned
Posted: 7th Dec 2014 15:35
You can't at the moment. The engine doesn't support that. As I understand it, though, such capabilities are coming in the next version.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
spudnick
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 7th Dec 2014 18:23
just an idea have you added effectbank\reloaded\character_basic.fx in the effects part of the fpe

have physics on but also give a weight to your character ie 100 and 100 on physics friction
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Dec 2014 21:45
sorry i meant with physics on in properties turn gravity off and on in the script, they should collide with objects but be able to move again, if not try lowering the weight a bit until they move more freely as spudnick says.
not really done anything with characters so not 100% but it should work.

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
tomjscott
User Banned
Posted: 7th Dec 2014 22:27
Trust me. It won't work correctly. I spent a great deal of time trying to make it work, but results are always pretty bad with the current release.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 8th Dec 2014 00:22 Edited at: 8th Dec 2014 00:38
I should add that im testing a custom character that currently does not have bones.







When I try setting it to character, it bumps into walls and things like that but floats a bit above the ground and the movements are bizarre. Guess I'll have to wait for future versions.

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 8th Dec 2014 20:13
Quote: "Trust me. It won't work correctly. I spent a great deal of time trying to make it work, but results are always pretty bad with the current release."


So I've learned :/

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 17th Dec 2014 10:43
I hope we can do what I'm intending to with the next release. I'm feeling a bit impatient since I can't fully test all the ideas running through my unstoppable creative mind lol

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 22nd Dec 2014 19:11
Does anyone know if this is now possible with the new release of Reloaded?

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 22nd Dec 2014 19:25
@Teabone
I have got my creature characters to animate and avoid objects using the AI but they have sunk into ground up to their knees.
( they are animating and standing on the ground in the editor but sunk into ground in test play)
This is a big step f
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 22nd Dec 2014 20:56
Just to confirm I got this working too with J_C's method - thanks for explaining. My model (a dog) doesn't sink into the ground though - it all looks normal - must depend on model?

J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 22nd Dec 2014 22:08
@cybernescence
Your's is a Rex one of mine is a T-Rex up to his knees in the ground...He must be too heavy...
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 23rd Dec 2014 03:51
@J_C - like it! LOL.

Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 23rd Dec 2014 07:18
Are you using the ischaracter value? That may explain why its falling into the ground. When I turn off ischaracter and just make it a dynamic character i seem to get better results. Only problem is trying to get them to move with proper physics.

Does your character go up hills and then down them? I find mine will go up but then start floating.

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 23rd Dec 2014 14:40
Yes I'm using ischaracter=1. I've now got a mech and a dog working using the 'csi' animations as stated in the fpe. They seem to work just like the stock characters in regard to following the AI commands within the lua scripts - follow the terrain etc. Very welcome addition.

Not sure why you are having issues. I have noticed it's a bit "sensitive" - I've had to restart reloaded as well as clear dbo/bin files - and even animation ranges starting with zero appear to have caused issues. With the mech character - the first time I tried, it sunk into the floor, then got dragged around without animating, but now seems to work fine. Wish I could be specific about what I changed other than making sure all the animation ranges were valid and not starting with a zero, I don't think I did anything else. I'd post a vid, but not sure how that helps you other than to give encouragement that it can work

J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 23rd Dec 2014 16:03
@Teabone
Yes I am using the ischaracter value = 1 ..
I have just tried the ischaracter = 0 and the T-Rex does stand on the ground and does his walk animation
but he is only walking on the spot - will not follow me anymore...
So the AI commands will
PM
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 23rd Dec 2014 16:14
Another Question.
These type of models are wider than the standard characters.. if I have more than one chasing me
they bump and merge into each other and sometimes clip obstacles...
Is there any variable value that can be set to increase the size that the AI uses for its route planning...
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Dec 2014 20:35
i had the sinking effect quite a while back while trying to use a turret as a character (worked before but stopped after 1.08 or 1.085 - whichever added working physics) i never got it working again so all i can say is that it is something to do with the physics and characters that causes it.

as for the clipping/merging i guess this is the collision mode that needs adjusting maybe.

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 24th Dec 2014 01:21
@smallg
I also had these working using the AI a while back.. They stopped working when they changed the LUA
so that only dynamic objects could run scripts... I think it was also about the time that the ragdoll was
being added... but ragdoll = 1 or 0
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th Dec 2014 12:02
interesting so if you scale them to match the size of the characters then all should work as expected

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 24th Dec 2014 17:17
@smallg
Happy Happy Holidays...

I was just coming on here to tell you of my progress and I see you have also got the key to success
I should have come in here earlier today... but I was on a quest..

So Yes that was the assumption I came to.
PM
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 24th Dec 2014 17:32
@smallg
I don't know what happened there I wasn't ready to send that last message...

Here is what I did...

My T-Rex I used scale = 70 in the Fpe and bingo he is walking on the ground but a little smaller but big enough for now..
Triceratops used
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th Dec 2014 20:44
unless you have ragdoll they wont die like the stock characters i guess - probably best if they dont anyway to be honest if they dont have the same structure, not sure how it'd handle it, though it might be fine.
not sure if the setting in the fpe alone is enough, might need some animer conversion or something maybe - pretty clueless on modelling side of things im afraid.

as for your own death animations well you can definitely do that but good luck getting it to run as once an entity reaches 0 hp the script should stop running which from my experience means they wont animate the death

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 25th Dec 2014 17:55
@smallg

After many hours of frustration testing this and that... I even tried making them explode to get them to die but that did not look too good..
But at last I managed to get my Death animation to play... ( I beat my chest like Tarzan when I got i
PM

Login to post a reply

Server time is: 2024-05-07 06:08:16
Your offset time is: 2024-05-07 06:08:16