Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 98 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Possible to have friendly AI use turrets/mounted MGs?
Shaocaholica
General Member
Since: Jan 28, 2010
Posts: 13
Last: Feb 4, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Wednesday, Feb. 3, 2010 04:13 am
While I dig through the supplied level scripts, I might as well ask here if its even possible at all to have friendly AI use turrets against enemy AI. I'm trying to put together a level and I wanted to setup some cover nodes with MGs for my friendly AI to use. I'm not sure how well the game handles that. I'd also need to get the friendly AI to move onto new cover so they need to detach from the turret as well.
Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD4 Scripting
Posted: Wednesday, Feb. 3, 2010 04:13 pm
Well as long as the path node is attached to the turret - if an AI uses that node he will mount the turret.

Then if your using color groups when the player moves on the AI will dismount and move on too.

Basically friendly and enemy AI are setup in the exact same way when using a turret [thumbs_up]
Share |
Shaocaholica
General Member
Since: Jan 28, 2010
Posts: 13
Last: Feb 4, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Wednesday, Feb. 3, 2010 06:41 pm
techno2sl writes...
Quote:
Well as long as the path node is attached to the turret - if an AI uses that node he will mount the turret.


You mean connected as in via the "W" key?

Well, I'm testing it out now but heres another question:

Whats the difference between a "misc-turret" and a "node-turret"?
Share |
Shaocaholica
General Member
Since: Jan 28, 2010
Posts: 13
Last: Feb 4, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Wednesday, Feb. 3, 2010 07:35 pm
Ok, that didn't work. I've tried different combinations of things and none of them worked. Can you be more specific? Do I need to run any code on the AI?
Share |
ivan_cro
General Member
Since: Jul 21, 2008
Posts: 463
Last: Oct 27, 2010
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Thursday, Feb. 4, 2010 12:06 pm
Well,

It's not good if you just connect paths manually. Easyest thing when you do paths for AI is to just throw around pathnodes, that you "targetname" one node E.G. "targetname" - "alliesend", and you name the AI you wanna go to that spot with "target" - "alliesend".

There is one more good thing to do. To trigger your AI.
It will be silly if your AI spawns and you are far away from it.
Connect some triggers -> multiples to your AI and place it where/when you want them to spawn.

You can also use your .gsc for it.
I'm not so perfect with scripting, and not for SP so much, but I guess you can find code in IW's, there's something with "goalnode", so in .gsc you targetname ur player, you type in .gsc, and after some event happends in your map, you just type after it: level thread youreventname(); E.G.

level thread soldier1move();

So, best thing for this is to use Your .gsc, so after something that will happend lets say tiger moving in town, you type after your tiger code this up what I wrote.

I hope it helped you.

IvanFilip.
Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD4 Scripting
Posted: Thursday, Feb. 4, 2010 02:20 pm
Have a path node at the trigger/stock of the MG and attach the node to the MG.

Grab an actor and attach the actor to the path node.

How to:

Select the nearest pathnode (pathnode should be where the AI gunner will actually be standing). Now select the MG and press W.

This connects them, so now when any AI is standing in that pathnode he will use the MG.

Select an AI/Spawner and then select the same pathnode. Connect them "W".

So now we've designated an AI to move there.

But he's only going to go there once. We could make him a spawner, forcespawn and give him a count:

targetname 10

So he'll spawn 10 times.

And then also attach him to a color group (Check the color groups tutorials) so now when you move further on in the level so will he.

OR

You can kill him via script and kill him in the level easily via a trigger.

So place a trigger multiple where you want the player to be when the MG guy stops spawning... and select the trigger and the spawner, hit "shift+g" and then tick script_killspawner.

This will assign him and the trigger with a unique key and value pair that will stop him spawning when the triggers condition is met (by default, the player walking through it).
Share |
Shaocaholica
General Member
Since: Jan 28, 2010
Posts: 13
Last: Feb 4, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Thursday, Feb. 4, 2010 04:10 pm
Thanks for the replies. I got it working yesterday. Actually, they are heroes which should not die. Instead, I'm just using a cover node where the MG is. No connected paths. I've got a thread that spawns bad guys and whenever a bad guy is spawned, I call useturret() on all my heroes. That way, if they ever leave the turret because of a grenade or something else, they will still go back to their cover node and the next enemy respawn will put them back on the turret. Still not perfect but it seems to be having the effect I want.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»