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
. 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
).
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 [ 67.09 KiB | Viewed 3549 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 [ 67 KiB | Viewed 3549 times ]
The machine has its revenge >D
Attachment:
File comment: The machine has revenge >D
ScreenDump022.jpg [ 55.2 KiB | Viewed 3549 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 [ 58.16 KiB | Viewed 3549 times ]
Cannon Amazing Dual Kill Headshot (1 of 2)
Attachment:
File comment: Cannon Amazing Dual Kill Headshot (1 of 2)
ScreenDump040.jpg [ 50.08 KiB | Viewed 3549 times ]
Cannon Amazing Dual Kill Headshot (2 of 2)
Attachment:
File comment: Cannon Amazing Dual Kill Headshot (2 of 2)
ScreenDump041.jpg [ 59.98 KiB | Viewed 3549 times ]