Data Realms Fan Forums
http://45.55.195.193/

Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA
http://45.55.195.193/viewtopic.php?f=1&t=18759
Page 1 of 1

Author:  Repy [ Sun May 16, 2010 4:58 am ]
Post subject:  Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA

Hello There.

This is my first post here and i plan to buy the game soon :D. I don't speak english very well, so sorry for any mistakes.

I'm making a (Bloody) Napoleonic Wars Mod, and i need some advice.

First of wall, i want to say that i plan to make an interactive battlefield, where the player will be able to take control of any soldier.

I already made a simple scene (on a plain dirt map) where soldier are spawned on both sides and they confront each other in the middle, left side is the player side.

Also, i made cool random cannon shots (just blazing balls spawning at high speeds from both extremities of the map) (it's not actually random cause lua's "random" command is pseudo-random, but it works :D).

My goal is to simulate a battlefield with decent soldiers behaviour and lots of gore and oceans of blood.

However, i can't workaround some problems.

First, every AI behaviour is disastrous. I thought the AIMODE_GOTO together with well-placed waypoints would do the job, but the soldiers keep walking over the other (of the same team) and killing their friends. So the temporary solution is to use the following:

Code:
actor:GetController():SetState(Controller.BODY_CROUCH,false);
actor:GetController():SetState(Controller.BODY_JUMP,false);
actor:GetController():SetState(Controller.MOVE_UP,false);
--actor:GetController():SetState(Controller.MOVE_RIGHT,false); (needed?)
actor:GetController():SetState(Controller.MOVE_LEFT,true);


and AIMODE_SENTRY.

also, the aimdistance for cpu actors must be a way higher to enable them to engage far targets, however, it seems impossible to set this in lua, i tried:
Code:
actor.AimDistance = 1000

and some other commands after defining the actor type and before actually creating it (MovableMan:AddActor).

Lua scripting is cool, but the other things (Actors, Effects, Materials) are very confusing, boring and badly documentated. Also, the arms and legs articulations sprites should be automagically generated imho.

I'm attaching some SSs. I've made one type of trooper (a napoleonic soldier, i plan to make one variation, and the other side, the allies, because it will reproduce the "real" (hehehe) waterloo battle).
I've made two kinds of blood, one is lighter and falls slowly.
The cannons projectiles (balls) i made, but the blazing trail are from the base files.
I made one weapon, the musket, the trail isn't very long in these pics because i'm using 'DeltaTime = 0.005', the smoke is also from the base files and i couldn't find a way to make the blades actually hurt.

My english is very bad and i really didn't mean to be rude or disrespectful. Sorry.

The SSs:

2 Troops Marching to Death.
Attachment:
File comment: 2 Troops Marching to Death.
ScreenDump003.jpg
ScreenDump003.jpg [ 67.09 KiB | Viewed 3557 times ]


Firing their muskets in vain against a high-tech flying-machine :).
Attachment:
File comment: Firing their muskets in vain against a high-tech flying-machine :).
ScreenDump010.jpg
ScreenDump010.jpg [ 67 KiB | Viewed 3557 times ]


The machine has its revenge >D
Attachment:
File comment: The machine has revenge >D
ScreenDump022.jpg
ScreenDump022.jpg [ 55.2 KiB | Viewed 3557 times ]


The cannonball hits his leg (poor guy)
Attachment:
File comment: The cannonball hits his leg (poor guy)
ScreenDump030.jpg [14.24 KiB]
Not downloaded yet


Cannon headshot.
Attachment:
File comment: Cannon headshot.
ScreenDump038.jpg
ScreenDump038.jpg [ 58.16 KiB | Viewed 3557 times ]


Cannon Amazing Dual Kill Headshot (1 of 2)
Attachment:
File comment: Cannon Amazing Dual Kill Headshot (1 of 2)
ScreenDump040.jpg
ScreenDump040.jpg [ 50.08 KiB | Viewed 3557 times ]

Cannon Amazing Dual Kill Headshot (2 of 2)
Attachment:
File comment: Cannon Amazing Dual Kill Headshot (2 of 2)
ScreenDump041.jpg
ScreenDump041.jpg [ 59.98 KiB | Viewed 3557 times ]

Author:  Natti [ Sun May 16, 2010 11:19 am ]
Post subject:  Re: Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA

Could you post the mod? I'd love to try it.

Author:  Geti [ Sun May 16, 2010 11:27 am ]
Post subject:  Re: Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA

Easy solution to soldiers crushing each other: HitsMOs = 0 in the AHuman definition.

Author:  lafe [ Sun May 16, 2010 12:34 pm ]
Post subject:  Re: Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA

welcome to the forums, i really look forward to seeing what you can do, cause this is better than most mods right here.
I would look at cavecrickets controller code for the ai

Author:  maart3n [ Wed May 19, 2010 2:18 pm ]
Post subject:  Re: Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA

I would use some of the code from the smartbrain, or anything similar to keep units from diving into the ground when they have the enemy's head in their crosshairs.

Oh and the blood looks great!

Author:  knight133 [ Sun Mar 25, 2012 8:34 pm ]
Post subject:  Re: Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA

what happen the Napoleonic mod of his? did he finish it?

Author:  Asklar [ Sun Mar 25, 2012 9:31 pm ]
Post subject:  Re: Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA

I've got a reason or two to think he didn't finish:

1) Last visited: Sun May 16, 2010 2:21 am
2) You've just necro'd this thread.

So don't get your hopes up.

Author:  joebobjoe [ Sun Mar 25, 2012 10:27 pm ]
Post subject:  Re: Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA

Actually i can definitely say he didn't finish it. He only has one post on the site.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/