Jump to content

NPC that always has saber on but never attacks


Recommended Posts

Hey guys, I need help with something - I want to make an NPC like what the title says. I want this because I want to make an NPC that holds @@Langerd's flashlight while the player walks around - empty handed. Thanks guys.

+ i purpose to make him walk instead of run. If player walk with the flashlight the torso is static and lightning is not jiggling around.

I will get up soon and try make script like that

Link to comment

flashlight_guy
{
    playerModel        jedi
    weapon            WP_SABER
    saber            flashlight

    FP_SABER_OFFENSE    1
    aggression        1
    aim            1
    evasion            5
    intelligence        5
    move            2
    reactions        2
    playerTeam        TEAM_NEUTRAL
    enemyTeam        TEAM_NEUTRAL
    class            CLASS_PRISONER
    runSpeed        120
    acceleration        20
    movetype        walk
    snd            humanmerc1
    sndcombat        humanmerc1
    sndextra        humanmerc1
}
 

Just an example of what you could do, of course because he's TEAM_NEUTRALl he won't follow you around like he would if he was TEAM_PLAYER for the playerteam, setting it to TEAM_PLAYER would result in npcs like reborn/cultist/merc/etc attacking him too, but that's for you to decide, the enemyteam TEAM_NEUTRAL is to ensure he is docile and won't attack anyone. I've set the class to CLASS_PRISONER to ensure there is no resistance to force powers.

 

I suggest using the https://jkhub.org/files/file/2420-npctool/ to help with the stats.

MB2 Beta Tester / MB2 FA Assistant Dev

Link to comment
  • 2 weeks later...

Okay, here's my NPC so far:

 

 

dkothos
{
playerModel jedi
customSkin steve
saber flashlight
saberColor orange
weapon WP_SABER
FP_HEAL 3
    FP_SABER_OFFENSE    1
    aggression        1
    aim            1
    evasion            5
  intelligence        5
  move            2
  reactions        2
    playerTeam       TEAM_ENEMY
    enemyTeam        TEAM_PLAYER
    class            CLASS_PRISONER
    runSpeed        120
    acceleration        20
    movetype        walk
    snd            prisoner2
    sndcombat        prisoner2
    sndextra        prisoner2
}

 

 

 

It works great! Only problem I'm having now, is the script - I want it to basically use the command "runscript steve follow_player" when I start up the map. How would I do this in Radiant? Thank you very much for your help, by the way :)

Link to comment

Okay, so I haven't made any progress with this thing whatsoever. Nothing I tried has worked... That being said, I don't know anything about scripting XD

I already have the script - it's running it when the map starts that's the problem :/

If I remember correctly you can target the scriptrunner from worldspawn.

So the scriptrunner gets the "targetname" "follow_player" and the worldspawn "target" "follow_player". The script should be automatically executed at level load then. (IF I remember correctly)

Is it running at map start or not?

Else, give the npcspawner the "follow_player" script as spawnscript?

Link to comment

Okay, so I haven't made any progress with this thing whatsoever. Nothing I tried has worked... That being said, I don't know anything about scripting XD

I already have the script - it's running it when the map starts that's the problem :/

If you want it to happen later you'll need to have it triggered somehow. Like the player touches a trigger which spawns the npc which runs the script.

 

Otherwise, your going to need to add to the script more instructions. Say add a wait task for 30 seconds then after that run the main task.

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...