Scripts / Body Script

Author
Message
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 18th Sep 2014 15:07 Edited at: 18th Sep 2014 16:36
Hi all. I have been wondering how to continue with my body script. I considered refining it and releasing on the Gamestore, but have decided to release it into the wild for free. All I ask is if people use it, some credit would be nice and also any refinements made to be released in this thread for others, including myself

I had a little help with this script from a friend who doesn't really frequent these forums. He is better at 3D maths than me and helped refine a couple of issues I had. So, in case he ever does have a look here, thanks!



In case you have no idea what this does, here is the video I made.





I have made it as easy as I can to implement. You will need to make a new character for this.



Copy the Combat Soldier files into a new directory within your entitybank folder. I normally use the users folder to add custom media, but it is up to yourselves where you put it.



With that done, copy over it's FPE with the one provided. The FPE contains the anim and collision data needed for the script and entity to work. It also automatically adds the script to the object, making it really easy to use in the editor.



Delete the current .dbo and .bin for your combat soldier copy.



Copy the body.lua script into the scriptbank folder.



Fire up Reloaded.



Add your new combat soldier model to the scene.



Add your player marker.



Test the game.



That's it! It doesn't matter where you place the body/combat soldier. The script automatically places it in the correct position for you. Issues I have noticed are that it can have trouble with different FPS rates. Possibly because Reloaded is taking certain variables to be a speed rather than an absolute. I have not investigated this as yet, but am sure it can be fixed. I have had the issue with other scripts in the past as well, so imagine it to be the same issue.



There's all sorts of stuff this script can be used for besides this. Want to have a jetpack? This script could easily be adapted to suit the new commands and give you a body to boot! Can't be bad



So, there you go. Consider it my early Christmas present for everyone. You could of course go visit my Youtube channel and subscribe, maybe catch a few vids now and then to show your appreciation Of course it is not mandatory. Being fellow creators perhaps you would find something of interest on there



Let me know what you get up here, and of course upload your modified, improved scripts that you derive from this (I'm sure there will be many) It all helps the non scriptwriters get into the games making process!



https://www.youtube.com/user/RetroGamebloke



Edit - I add that the code has some useless stuff in there still. I have not cleaned it up beyond removing a few remmed lines Feel free to remove some of it.



SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.

Attachments

Login to view attachments
RustyNuts
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 9th Nov 2011
Location: Warwickshire Great Britain
Posted: 18th Sep 2014 18:05
Most kind of you DVader for sharing this. I have been keen to get my hands on this as i am excited to see how you did this..

All programmers are playwrights and all computers are lousy actors.
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 19th Sep 2014 02:23
Thank you very much. Truly generous. This could have so many applications.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 4gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 19th Sep 2014 14:06
Well, I was seriously considering seeking your code in WikiLeaks, but very pleasantly have checked that this was not necessary, because you are a great guy.
Thanks mate for share it.

3com
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Sep 2014 16:08
Thanks guys. There are indeed many applications for this. Nothing to stop you changing the model to a different one as long as you have the anims to replace the default ones. You might even find one with a straffe anim Still I didn't consider it all that important in general. The body is there for effect in the main and it is doubtful people will play a game constantly checking they are animating correctly. I checked this with water also, but although there, the reflection is literally straight down underneath you and so not easy to spot.
When we have mirrors in game, this could help reduce the illusion you are a vampire



SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 19th Sep 2014 16:51
Work wonderful out of the box. very cool. great job. Now I will see how to changes things.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 4gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Sep 2014 18:04
impressive that you managed to get so much working without any input checks at all and am also very surprised there's no flickering while moving, great work

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 25th Sep 2014 12:14
Thanks guys. It reminds me a little of that old Jurassic Park game, Survivor was it? Only without boobs Anyway that's what I was thinking of when I made the script, not boobs, the viewpoint



SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
s4real
GameGuru Tool Maker
18
Years of Service
User Offline
Joined: 22nd Jul 2006
Location:
Posted: 25th Sep 2014 15:31
Thanks for sharing this with us all.

best s4real

Specs :- Amd fx4100(4.0),6gb of ram,

MSI AMD Radeon HD 7770 ,windows 8.1 64 bit version.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Sep 2014 17:51
Quote: "not boobs, the viewpoint"

lies

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 25th Sep 2014 20:44
That looks pretty great. I didn't expect to see a player shadow either. Just awesome.

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
drewtaylorr
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 18th Jun 2013
Location:
Posted: 26th Sep 2014 23:30
Does anyone else have any rigged and animated legs for the body script ? Without the arms tho so that you can pickup weapons and not have 2 sets of hands.

Kill or Be Killed
Conjured Entertainment
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 27th Sep 2014 05:22
Very cool, thanks.

Quote: "There's all sorts of stuff this script can be used for besides this."

That's what I was thinking.
If the body can be behind then it can be in front, and it doesn't have to be a human body.
LOL think of the player as a robot, or an alien.
Cool script indeed, thanks again.

Corno_1
GameGuru Tool Maker
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 27th Sep 2014 09:22
Wow Thanks for this

My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 27th Sep 2014 14:55
Cheers all. I'm glad you like it.
@Conjured Entertainment, yeah you can place the body anywhere you wish, however, it will not work for a third person system, without camera control. If you tried to place the body ahead of you to simulate it, the player would rotate ahead of you as if you had him on a stick and was turning around. It may work for some things but in the main will look a little odd. Having big Mech arms swinging away like you are in the loader from Aliens would be cool though No way to change it so the camera rotates around the object as yet. But I am sure they will add support at some point.
@ drewtaylorr, you could replace the combat soldier with any of the other characters available, however you would need to change the animation values I have set in the FPE. Same goes for any custom characters you may have. The arm thing is the only problem when using this with weapons. Although I am fairly Jack of all trades, rigging human or other models is still a bit beyond my skill set. Any attempts at rigging custom models with bone anims have so far not worked for me. I don't have 3ds max to look at the standard ones either. You would probably get away with removing the arms tbh to get this looking better with a weapon. The shadow would probably look odd as well

At the minute it would work best in a non action orientated game. Still it works surprisingly well with the gun in the main. Hiding the arms would probably do the trick quite well. If anyone wants to make a specifically designed model to work better when using guns feel free and let people know here!

Still, thinking back to the more adventure orientated uses. Imagine instead of having an item vanish when you collect it, you set the body object to play a grab animation, and pick it up. Maybe pushing a door open etc. Fair enough, not as simple as it sounds to make it look right, as you could pick things up from any number of positions, but the concept is there.



SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
science boy
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location: Up the creek
Posted: 6th Oct 2014 21:53
Best option would be to erase the arm textures so would not be drawn

an unquenchable thirst for knowledge of game creation!!!
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 7th Oct 2014 13:09 Edited at: 7th Oct 2014 13:09
Quote: "as you could pick things up from any number of positions"




Could you not edit the pickup script so that the user can only pick items up if the screen is centred on item? Then essentially freeze the player controls for a second, so that the player can't move away from that point while the animation is playing?



Great job on the body script though!



Cheers



Jay.





DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 7th Oct 2014 15:22 Edited at: 7th Oct 2014 15:25
There's not really a way to check if you if you are centered on the item beyond distance (and angle) at the moment. Also, no way to freeze the player as such either as yet. Still, I've done a pickup script based on this one now, that works like a little like Half Life 2. Anims would have to be fairly generic and hence not great, or customized for each object (Not a job I would fancy much, lol), but they could be added I imagine. Easier if you limit items you pick up, more so than if you want to be able to pick up any reasonably sized or shaped object. We just need a few more commands to do it properly. Being able to disable the player movement keys and also independently, the mouse look, shooting, jumping, would help. Not to mention having access to all keys and mouse inputs as well, so we can select menu items when we have the ability to make them.



Edit - Forgot to mention, clearing the textures for the arms is a good idea. Would probably work quite well. The shadows may still look odd of course!



SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
Isagabe
10
Years of Service
User Offline
Joined: 12th Sep 2014
Location:
Posted: 8th Oct 2014 08:42
Just watched the vids. Brilliant. From a none coder point of view, mind blowing. Thanks for this. Would happily pay for a scrip pack of this nature. Name your price.
drewtaylorr
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 18th Jun 2013
Location:
Posted: 13th Oct 2014 17:58 Edited at: 13th Oct 2014 23:11
nice

Kill or Be Killed
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 13th Oct 2014 18:30
Quote: " Not to mention having access to all keys and mouse inputs as well, so we can select menu items when we have the ability to make them."

I really want this.
You might to do inventory and interact with different ítems.
For example, two items which together form a third ítem.

3com
PM
tomjscott
User Banned
Posted: 13th Oct 2014 21:15
Quote: "Also, no way to freeze the player as such either as yet."


Actually, you can do this with Omega Core and the ocBlockInput function call.

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
tomjscott
User Banned
Posted: 13th Oct 2014 23:02
Quote: "Not to mention having access to all keys and mouse inputs as well"


Yeah, omega core can do this as well.

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
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 14th Oct 2014 16:04
That sounds good Tomjscott, although (so far) I have only worked with standard Reloaded stuff, so as to keep confusion levels down. Needing to download your plug in as well as setting up the script, is an added complication most non coders will want to do. Sounds a great add on for coders making their own game though and an impressive job on getting it working. I ignored the hooha when Lua was first supported in DB pro and so never got into it until when Reloaded started supporting it really, so missed any of the lua stuff in-between. I should take a look at it, but have always been wary of addons, not because there's any issue with them. More because I tended to forget which ones I had used in the past when going to a new system and ending up scrapping projects, lol. Should have kept a copy, and made notes, but hey ho, lol.



SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.

Login to post a reply

Server time is: 2024-12-21 18:05:37
Your offset time is: 2024-12-21 18:05:37