Aller au contenu

Photo

OnHeartBeat Vs OnSpawnScript


  • Veuillez vous connecter pour répondre
10 réponses à ce sujet

#1
Xeneize

Xeneize
  • Members
  • 133 messages

Greetings!

 

This time I come with a dilemma I can't seem to resolve. I gather that if I want something to be repeatable every six seconds, OnHeartBeat scripts are the best to go for. Alas, I find myself with the issue that I'd like some of my npcs to perform several tasks, and these tasks, take more than six seconds to accomplish. What this means is that right now with an OnHeartBeat script I'm being forced to cut back on the commands I give to my npc because it will restart from 0 before the npc is done doing what I want it to do.

 

That is why I have been looking into possible ways to accomplish the same thing an OnHeartBeat script does but with a longer lapse of time. I've looked into OnSpawnScript, because it seems like the most logical choice to go for as I want my npcs starting to do their things the moment they spawn.

 

Alas, my problem now is that I do not know how to tell the script to recycle once it's reached and done all the commands in the lines.

 

Is there a way to tell a script to restart from the beginning once it's finished its last command?

 

Thanks in advance for the help!



#2
kamal_

kamal_
  • Members
  • 5 250 messages

The problem isn't sufficiently defined for us, and there are multiple ways of doing what you ask.

Let's start with what tasks and where will they do them, exactly?



#3
Xeneize

Xeneize
  • Members
  • 133 messages

Perform animations, walk from a certain point to the other, speak floating strings mostly.



#4
kamal_

kamal_
  • Members
  • 5 250 messages

Perform animations, walk from a certain point to the other, speak floating strings mostly.

You want this sticky, it covers what you are asking:

http://forum.bioware...ypoints-repost/



#5
Xeneize

Xeneize
  • Members
  • 133 messages

Okay, that worked, thanks very much :)



#6
Xeneize

Xeneize
  • Members
  • 133 messages

Hmmm it all worked wonderfully till I tried to have my npcs attack one another to simulate a fight, or attack an object, (A dummy) for training. What options are there to accomplish such a thing?



#7
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 592 messages

In my King's Festival campaign I have a couple of NPC's battling each other. I just assigned each to a faction that hated the other faction and set each to immortal and plot so they cannot kill each other.  To keep them from being interrupted by conversation attempts I used a custom on conversation script called bb_noturn_convo which is a modified version of the SoZ f100_noturn_convo script.

 

This is all in the area 0100_ext_stallanford of module KingsFestivalMod1.  The NPCs are tagged c_hatfield and c_mccoy.

 

Regards



#8
Xeneize

Xeneize
  • Members
  • 133 messages

I can try that. But how do I exactly export a custom faction? Will the fact I create it and then add it to the npcs that I export be enough, or do I have to export a particular file that has the module's factions?

I ask because if the new factions work in my module, but don't in the module I export them to, there would be a problem :P



#9
kamal_

kamal_
  • Members
  • 5 250 messages
Custom faction names are saved on the blueprint, but the faction name must be an exact match for a faction in the new module for it to show up when imported into the new module. You can either recreate the faction, or copy over the faction file (repute.fac, back up the original first of course).

#10
Xeneize

Xeneize
  • Members
  • 133 messages

So it's the repute.fac file of a module that has the factions? Which folder is this file usually?



#11
4760

4760
  • Members
  • 1 207 messages

You'll find it in your module folder (if you saved it as a .mod file, it's included in the .mod).