Jump to content

npc route in mp


Go to solution Solved by Szico VII,

Recommended Posts

Hey guys :)

 

its me again. I want to add a route and action (like use some trigger etc) to some npcs appearing in my multiplayer map. How do I do that? I've found an old tutorial here on jkhub, but thats not longer available.. Can please some1 tell me how to do that? I know there are some entities and waypoints I've to connect with the npcs, but I need to do some scripting.

 

Thanks for help!

curve

Link to comment
  • 2 weeks later...

Not possible in multiplayer. The only game that is capable of running NPC characters inside the MP section, is Elite Force 2 but that is because the SP and MP part share the same executable . . .

 

Hmm? JA multiplayer has working NPCs. Or am I misunderstanding what you mean?

Link to comment

Hmm? JA multiplayer has working NPCs.

If it is possible however I never saw it in any MP maps I've played . . .

 

Or am I misunderstanding what you mean?

Jedi Academy comes with both jasp.exe and jamp.exe, one for the single player portion and the other for the multiplayer portion. Altough they share a lot of content (e.g: /base map), a lot of specific code are stored in their respective executables, which cannot be attained by the other executable. This happened a lot in Raven games that utilizes the idTech3 engine and in the example of Elite Force 2 (which was developed by Ritual), only one executable is used by both the singleplayer and multiplayer portions and that is why elements from one portion can be used in the other, such as NPC scripting.

Signature.jpg

Link to comment
  • Solution

@@curve

In Atlantica, I managed to do some basic NPC scripting behaviour, in the non-RPG version. Have a look at the source files for some info.

https://jkhub.org/files/file/1561-atlantica-fix/

 

Specfically, theres NPCs walking around, sitting on benches e.t.c - This was done in the background_functions script file.

 

Example:

rem ( "Move NPC Jedi 1" );

affect ( "jedi1", /*@AFFECT_TYPE*/ FLUSH )
{
    flush (  );
    set ( /*@SET_TYPES*/ "SET_WEAPON", /*@[member='weaponx']_NAMES*/ "WP_NONE" );
    set ( /*@SET_TYPES*/ "SET_WALKSPEED", 200 );
    wait ( 4000.000 );

    loop ( -1 )
    {
        rem ( "Jedi sits down" );
        set ( /*@SET_TYPES*/ "SET_NAVGOAL", "nav1_sitdown" );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT4" );
        wait ( 1800.000 );
        rem ( "Jedi gets up and walks to waypoint 2" );
        set ( /*@SET_TYPES*/ "SET_NAVGOAL", "nav2_garden" );
        set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_STAND1" );
        wait ( 8000.000 );
        rem ( "Jedi walks to waypoint 3" );
        set ( /*@SET_TYPES*/ "SET_NAVGOAL", "nav3_garden" );
        wait ( 8000.000 );
        rem ( "Jedi walks to bench" );
        set ( /*@SET_TYPES*/ "SET_NAVGOAL", "nav1_garden" );
        wait ( 8000.000 );
    }

You might wonder why theres so many "set-anim" commands. Well thats because it doesnt work properly in MP, and wont repeat or hold an animation. Therefore you have to manually add in how many times you want the animation to run inside of any looped command where there are other actions. The navgoal stuff seems to work fine though.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...