Jump to content

Home

NPC Trouble


Mr. Chopper

Recommended Posts

Problem: I place an NPC Stormtrooper in my map. He stands still, just turns around and shoots at me. I place a reborn NPC in the same map, and he jumps around, and moves and chases me and stuff. I want the Stormtrooper to do the same thing. I should probably also mention I made a script for the NPC that I think might work, but have absolutely no idea how to make it and the NPC interact.

 

Solution: __________________________________

Link to comment
Share on other sites

You're right, he did.... and I already have a script. But I don't know how to make it interact with the stormtrooper npc.... that's my problem right now. Though I probably missed it, I didn't see in the tutorial any examples of linking scripts to npc's.:confused:

Link to comment
Share on other sites

Ok, progress. I got the script written, and I think/hope it'll work for the npc.... here it is.

flush (  );

affect ( "hyttrooper", /*@AFFECT_TYPE*/ FLUSH )
{
set ( "set_walking", "true" );
set ( "set_behaviorstate", "bs_default" );
set ( "set_chase_enemies", "true" );
set ( "set_look_for_enemies", "true" );
}

I don't think it's working, so either my code is bad, or it's STILL not talking to the NPC.:mad:

Link to comment
Share on other sites

Actually I think all of the commands in your script belong to the default "personality" of stormtroopers. Although you might get better results with running than by walking.

 

To use that script, you gotta give the NPCs a spawnscript (or affect them later). If you use it as a spawnscript, you don't need the affect command in your script. To give a spawnscript, type in the entity properties:

 

spawnscript

mymapname/spawnscriptname

 

Don't add the .ibi to the end of the file name in Radiant entity properties, even if it's a part of the compiled script name. That path of course assumes the script is located in a subfolder named after your map in the scripts folder.

 

More critical than that next to useless script are however, as Mercenary mentioned, the point_combats (locations the STs will use as optimal hiding / shooting places) and a waypoint networks connecting the point_combats to each other (or any two or more places for that matter).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...