View unanswered posts | View active topics It is currently Sat Dec 28, 2024 4:11 pm



Reply to topic  [ 8 posts ] 
 Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA 
Author Message

Joined: Sun May 16, 2010 4:14 am
Posts: 1
Reply with quote
Post 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 3558 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 3558 times ]


The machine has its revenge >D
Attachment:
File comment: The machine has revenge >D
ScreenDump022.jpg
ScreenDump022.jpg [ 55.2 KiB | Viewed 3558 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 3558 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 3558 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 3558 times ]


Sun May 16, 2010 4:58 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jul 03, 2009 11:05 am
Posts: 3878
Reply with quote
Post Re: Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA
Could you post the mod? I'd love to try it.


Sun May 16, 2010 11:19 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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.


Sun May 16, 2010 11:27 am
Profile WWW
User avatar

Joined: Sat Mar 28, 2009 2:33 pm
Posts: 718
Reply with quote
Post 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


Sun May 16, 2010 12:34 pm
Profile
User avatar

Joined: Tue Dec 23, 2008 8:04 pm
Posts: 1545
Reply with quote
Post 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!


Wed May 19, 2010 2:18 pm
Profile

Joined: Sun Sep 26, 2010 8:00 pm
Posts: 8
Reply with quote
Post Re: Bloody Mod -How to Workaround Bad AI and Set AimDistance LUA
what happen the Napoleonic mod of his? did he finish it?


Sun Mar 25, 2012 8:34 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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.


Sun Mar 25, 2012 9:31 pm
Profile

Joined: Thu May 19, 2011 2:40 am
Posts: 17
Location: on the tradestar
Reply with quote
Post 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.


Sun Mar 25, 2012 10:27 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.039s | 15 Queries | GZIP : Off ]