The Elder Scrolls Forums

TES Construction Set and Plugins >> General TES Construction Set

Pages: 1 | 2 | (show all)
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
NPCs run in a straight line
      #2962568 - 08/23/04 06:18 PM

How do you do this? Also, how do you make an object fly in a straight line, then have it activate a script when it collides with something? I think MadMax used something like this when he made the cannons in his fishing academy, but I can't access it, so if he did do this, could someone please copy a section out of the script to show me? That would be great. Thanks.

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Wizthis
Adept

Reged: 05/31/04
Posts: 264
Loc: In front of my computer at the moment
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2963042 - 08/23/04 08:39 PM

Try this thread re: Path Grids

--------------------
Here are Links to .DDS, .Tga, .Nif, 3D Programs and Plug-ins.

Post Extras: Print Post   Remind Me!   Notify Moderator  
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
Re: NPCs run in a straight line [Re: Wizthis]
      #2963132 - 08/23/04 09:12 PM

Not quite what I want. I am going to have a script that places an NPC at the player's location, and I want it to run straight forward. Also, collision detecting is vital. Could anyone help me with this?

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Mode_Locrian
Diviner

Reged: 10/07/02
Posts: 2084
Loc: Bjornholm, Rykith Lowlands Region
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2963212 - 08/23/04 09:32 PM

If you want the NPC to actually run, I think you'll have to use a combination of forceRun and AITravel. I'm not really familiar with the intracies of AITravel, though, so I'm probably not the best person to offer help.

--------------------
My Website
Bards of Vvardenfell Thread (New Info 8/15/04)


Post Extras: Print Post   Remind Me!   Notify Moderator  
cyran0
Initiate

Reged: 06/04/04
Posts: 58
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2963366 - 08/23/04 10:10 PM

Quote:

Not quite what I want. I am going to have a script that places an NPC at the player's location, and I want it to run straight forward. Also, collision detecting is vital. Could anyone help me with this?



Do you intend to use PlaceAtPC to bring the NPC into the world with the player? The direction (0=front, 1=back, 2=left, and 3=right) value will align the NPC relative to the playerís facing. I havenít paid close attention to this, but logic suggests that wherever side of the player to locate the NPC, the latter will be facing the player (someone else can jump in here anytime). So if you want your NPC to run forward away from the player, assign 1 for the direction, and perhaps 1 (zero may confuse the facing issue) for the distance. Then force run the NPC to run ForceRun, and presumably the NPC will take off in a straight line away from and in front of the player (until he runs into something). You can check for collision with if ( GetCollidingActor == 1 ), and then further direct the activities of you NPC. If you need to change or use a different direction then the four principle, or run a specific distance, it will be more complicated, but may be possible by using the players position and facing as a reference.

Oops. I just checked with MFSD and I am wrong about the use of GetCollidingActor. It only works for a script placed on the object with which the NPC is colliding. Unless you know exactly where this is going to happen in the world, it is of no use to you. I'm not certain how you can check for collision. If he hits something running fast enough, maybe he will be damaged and you could check his health.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Wizthis
Adept

Reged: 05/31/04
Posts: 264
Loc: In front of my computer at the moment
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2963570 - 08/23/04 11:04 PM

I runnin around doing a few things-sorry for the brief answer.

Is there a script on "What's her name" in the Mages Guild when she comes down stairs and you place that Fake SoulGem in her desk? All you may need to add is Forcerun or something like that.
If so, That might help.
Try SFD8 too. I saw something (I think) in it regarding this very same thing.

I can't think Off hand of any "exterior" events with NPC's that do this-but I'm certain there are as I am Brain Dead at the moment.
I'll learn off this thread too-I'll keep an eye on it. Good luck.

--------------------
Here are Links to .DDS, .Tga, .Nif, 3D Programs and Plug-ins.

Post Extras: Print Post   Remind Me!   Notify Moderator  
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
Re: NPCs run in a straight line [Re: Wizthis]
      #2966343 - 08/24/04 05:54 PM

How about this: I have the NPC run in a straight line using ForceRun, then have it place an invisible object at its feet, which then makes a GetCollidingActor check and disables/deletes itself. Would this work? Hey WizThis: You seem to like my threads. I'm glad. Maybe I could provide you with some more help. PM me with any troubles you are having. You have some cool ideas, maybe we could set up an agreement.

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Simpleton
Acolyte

Reged: 07/02/04
Posts: 138
Loc: Earlham College, Richmond, IN
Re: NPCs run in a straight line [Re: cyran0]
      #2967249 - 08/24/04 10:41 PM

npc's collide with things, and I believe it even works if you setpos them (correct me if I'm wrong), but you may have to disable enable them every frame.

Assuming all that is correct you can simple setpos the actor someplace and then use getpos to get it's actual postion, if it's actual position doesn't match where it's supposed to be, then it means it collided. Something like this was what MadMax used to detect collision in his Fishing Academy mod.

--------------------
Do you have a burning desire to give me money?
Click Here to Donate

Post Extras: Print Post   Remind Me!   Notify Moderator  
Wizthis
Adept

Reged: 05/31/04
Posts: 264
Loc: In front of my computer at the moment
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2967704 - 08/25/04 01:17 AM

Quote:

Hey WizThis: You seem to like my threads. I'm glad. Maybe I could provide you with some more help. PM me with any troubles you are having. You have some cool ideas, maybe we could set up an agreement.




Are we talking $$$$? For the right amount, I'll have my team over to make you a new game!

Seriously, you want to push the envelope with this game and it intrigues me to no end. The game has limitations and flaws, and the only way to figure out "work arounds" are people like you and threads like this. I learn in the process.

It seems that nobody can tell you "It can't be done" and it's times like those someone stumbles over a "Oh...I guess it can!" Don't ever loose that attitude.

Someone told me there was no way to stop NPC's from falling through floors into oblivion. Giving them "SlowFall" as suggested ( See: Death by doors ) made things worse. I experimented...and placed collision barriers under the floor. No patroling guards or Dancers have mysteriously disappeared to this day. Something new...No...but don't tell me it "can't be done".

With regards to your idea. Two ways you may consider. GetDistance and Get Seconds past (Timed). Why?! If an NPC goes off even on a "slight tangent", it may not hit anything...and the rest will be lost all after that. There are many other ways to activate the event you wish. (What ever exactly that may be)
I'm not certain of exactly what you wish to do in the grand scheme of things. Now that I have GOTY-I can do more. Post or PM what you wish to do-I'll try to help.
Good luck.

--------------------
Here are Links to .DDS, .Tga, .Nif, 3D Programs and Plug-ins.

Post Extras: Print Post   Remind Me!   Notify Moderator  
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
Re: NPCs run in a straight line [Re: Wizthis]
      #2969624 - 08/25/04 04:48 PM

Simpleton-Not what I want, although a good idea. I'm going to use PlaceAtPc to place the NPC, so I won't know where to put SetPos, and I really don't want them in a set position anyway.

WizThis-What I really want to do is have a new spell effect-see my thread in the Morrowind Mods section Suggestions for new spell effects which places an NPC at the player that looks like a lump of dirt which will, when it collides with an actor, explode up into a column of rock, damaging whatever it hits. The imaging is not a problem, with a modelor (just make a robe that looks like the lump of dirt) but I need all the collision stuff. Also, if you have any more ideas for spell effects that Bethesda left out, post them in that thread. Peace out, dude.

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Edited by The_Silent_Pyro (08/25/04 05:18 PM)

Post Extras: Print Post   Remind Me!   Notify Moderator  
Wizthis
Adept

Reged: 05/31/04
Posts: 264
Loc: In front of my computer at the moment
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2969692 - 08/25/04 05:05 PM

Session invalid. (????????)
This message occurs because you have either previously logged out
or your session has automatically timed out.
Please click here to login.
ALLTEL Internet Services E-mail
--------------------------------------------------------------------------------
Linky No worky!

I get the Idea. I'll look at the aspects of doing this.
But it sounds good-getting Sand kicked in the face would tic me off.

--------------------
Here are Links to .DDS, .Tga, .Nif, 3D Programs and Plug-ins.

Post Extras: Print Post   Remind Me!   Notify Moderator  
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
Re: NPCs run in a straight line [Re: Wizthis]
      #2969748 - 08/25/04 05:20 PM

Sorry about that. I think I fixed it, though. But really. Any suggestions for new spell effects would be welcome, but please post them there, to keep them in the right forum at least.

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Simpleton
Acolyte

Reged: 07/02/04
Posts: 138
Loc: Earlham College, Richmond, IN
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2969917 - 08/25/04 06:02 PM

setpos takes floats. Right after you PlaceAtPC call GetPos and boom, you have your origin. Figure out your angle, do a little trig, and off ya go, that easy. I'm gonna test that theory with the collision detection and I'll tell you if it works.

btw, you could run into problems if this thing moves into another cell, might require some scripting tricks to make it work.

--------------------
Do you have a burning desire to give me money?
Click Here to Donate

Post Extras: Print Post   Remind Me!   Notify Moderator  
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
Re: NPCs run in a straight line [Re: Simpleton]
      #2970202 - 08/25/04 07:20 PM

Ah, yes. Scripting tricks. Well, that's what I'm working on at the moment, although I have no way of testing them. My computer is whacked up at the moment, it isn't even recognizing one of the drives. Frustrating as h***, let me tell you.

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Scythor
Layman

Reged: 08/25/04
Posts: 5
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2971517 - 08/26/04 03:46 AM

I'm relatively new to this but maybe it helps to make the NPC ForceRun and activate a specific object using AIActivate (should need Tribunal, check out MW Scripting for Dummies on this, it's page 68) If you script the Activator to work only with a special Item in the inventory of the Actor activating it (I think some special Clothing might be good here since it cannot be stolen if equipped, if you can detect them maybe even a special spell could work work) you might produce an effect that can be checked for, so you have something similar to a collision detection...
If you only want to make the NPC run and check if it collides with anything, I cannot probably help you at the moment either.

Post Extras: Print Post   Remind Me!   Notify Moderator  
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
Re: NPCs run in a straight line [Re: Scythor]
      #2973069 - 08/26/04 06:10 PM

If I understand you right, that's not what I want.
Here's what I want, the whole thing, not just the part which I have explained here:
I am building a new guild of mages, one that works with the more chaotic sections of magick: the elements. They work with ALL the elements, not just fire, shock, and frost. One of the spells that they will give as a reward is a Mud Bomb spell. It's effect, when cast, will create a rock at the player's feet (actually an NPC which looks like a rock, as I think this is the best way to do it) which will "roll" forward at a good speed, and which will explode upwards with a column of damaging earth when it hits anything. I think I may have figured out a way to detect it colliding with actors, but I cannot find a way to detect static objects, to make it explode when it hits them like all other spell effects in the game.
The way I think to make it detect actors:
Have the "rock" ForceRun forward, then every frame place an invisible activator right in front of it which detects for a colliding actor then disables and deletes itself. This does not detect collision directly, but it is near enough to make it seem like it does. Now if there was only a way to detect statics...

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Post Extras: Print Post   Remind Me!   Notify Moderator  
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2973082 - 08/26/04 06:18 PM

Quote:

How do you make an object fly in a straight line, then have it activate a script when it collides with something? I think MadMax used something like this when he made the cannons in his fishing academy, but I can't access it, so if he did do this, could someone please copy a section out of the script to show me? That would be great. Thanks.




Can no one help me with this part?

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Simpleton
Acolyte

Reged: 07/02/04
Posts: 138
Loc: Earlham College, Richmond, IN
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2973210 - 08/26/04 07:01 PM

You can use an invisible creature (with a 100 slowfall ability) and setpos it to your invisible activator every frame. Every frame have the creature check it's distance from where it's supposed to be, if it is above 1, you've collided.

A related problem I've run into is that if you SetPos the activator inside of an actor it won't trigger GetCollidingActor, it only works if the actor runs into the activator at just the right moment.

Anyways I have a thought that may or may not work. Ok when you cast the spell it creates 3 things, the invisible activator, the invisible creature, and your little mud man. The invisible activator will move towards the direction the player was facing, and do actor collision detection. The invisible creature will SetPos to near the activators current position (have to make sure the activator doesn't collide with the creature) every frame and do landscape collision detection. Then finally the mud man will AI follow the invisible creature to the target. Though that last part *might* only work in exterior cells..

So there, it is *theoretically* possible. The actual scripting wouldn't even be that bad either.

--------------------
Do you have a burning desire to give me money?
Click Here to Donate

Post Extras: Print Post   Remind Me!   Notify Moderator  
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
Re: NPCs run in a straight line [Re: Simpleton]
      #2973523 - 08/26/04 08:44 PM

Simpleton, would you be willing to help me? I think I understand what you are saying, my only problem I have is for the moving the activator-how do I do it? I can't use SetPos on it, as I don't know where the player will be or what direction they will be facing when they cast the spell. I just got an idea, though. What if I had the player cast the spell, which summoned the running NPC, which then placed another invisible NPC in front of it, which used GetPos to set some coordinates and then checked them again GetPos the next frame? Would this work on statics AND actors? Or would I still need the activator? Or is this just an incredibly stupid idea, whcih would make me an incredibly huge idiot?

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Post Extras: Print Post   Remind Me!   Notify Moderator  
cyran0
Initiate

Reged: 06/04/04
Posts: 58
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2974361 - 08/27/04 01:02 AM

Quote:

I can't use SetPos on it, as I don't know where the player will be or what direction they will be facing when they cast the spell.



At the moment the mud bomb is created, check the playerís position with GetPos. E.g., set myX to ( player->GetPos, x ) . Repeat for y, z and z rotational axis. Use that data as a reference point.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Simpleton
Acolyte

Reged: 07/02/04
Posts: 138
Loc: Earlham College, Richmond, IN
Re: NPCs run in a straight line [Re: cyran0]
      #2975787 - 08/27/04 02:01 PM

You need to use the move function. Though to be honest this is so complicated even if we got it running it would probably have some large bugs in it or not turn out how you had hoped... Depending on how integral this spell is to your mod you may just want to opt for somthing simpler or more straight forward, at least for now. Whatever you decied to do if you run into a problem I'd be happy to help.

--------------------
Do you have a burning desire to give me money?
Click Here to Donate

Post Extras: Print Post   Remind Me!   Notify Moderator  
Wizthis
Adept

Reged: 05/31/04
Posts: 264
Loc: In front of my computer at the moment
Re: NPCs run in a straight line [Re: The_Silent_Pyro]
      #2976094 - 08/27/04 03:32 PM

Quote:

One of the spells that they will give as a reward is a Mud Bomb spell. It's effect, when cast, will create a rock at the player's feet (actually an NPC which looks like a rock, as I think this is the best way to do it) which will "roll" forward at a good speed, and which will explode upwards with a column of damaging earth when it hits anything. I think I may have figured out a way to detect it colliding with actors, but I cannot find a way to detect static objects, to make it explode when it hits them like all other spell effects in the game.
The way I think to make it detect actors:
Have the "rock" ForceRun forward, then every frame place an invisible activator right in front of it which detects for a colliding actor then disables and deletes itself. This does not detect collision directly, but it is near enough to make it seem like it does. Now if there was only a way to detect statics...




Simpleton is right. The more complex, the more Bugs. (And what was suggested-have something follow a following thing at XYZ which follows and expodes..yikes!!!)

Do/Mod a Biped. A rock with feet. If you can summon a Clan fear or skelaton, you can summon this rock. And it will run and chase your foe. You suggested redoing a "Robe" with a stone skin. Get someone (Better than I and I have Max 6-so that;s no good.) to do a Chest mesh. No head-jus a rock with rocky legs. It runs up and has a "Simple" script. GetDistance <5 . Booom!!! If Distance Player <25 Don't go Booom!!! ;don't kill the messenger. OR: Do a timer! If your rock/Bomb does not get anything in a certain amount of time-it goes booom!! (No matter what) Just like cooking off a missle in other games.
Stuff like that...which is proven to work.

The good thing about a new mesh is that I read someone figured out how to make things "Shatter" into pieces. That is what you want I guess-a fragmentary NPC or body part? If a "Chest Body part can NOT be done-then a "billowy rock" clothing mesh and skin and the skin of the NPC is--well---Rock. Try to keep it less complex. But you will need help with someone with Max4 or 5.

Maybe I am off the mark here-if so--sorry.

--------------------
Here are Links to .DDS, .Tga, .Nif, 3D Programs and Plug-ins.

Post Extras: Print Post   Remind Me!   Notify Moderator  
The_Silent_Pyro
Acolyte

Reged: 08/15/04
Posts: 124
Loc: Red Mountain
Re: NPCs run in a straight line [Re: Wizthis]
      #2978677 - 08/28/04 08:04 AM

Quote:

Do/Mod a Biped. A rock with feet. If you can summon a Clan fear or skelaton, you can summon this rock. And it will run and chase your foe. You suggested redoing a "Robe" with a stone skin. Get someone (Better than I and I have Max 6-so that;s no good.) to do a Chest mesh. No head-jus a rock with rocky legs. It runs up and has a "Simple" script. GetDistance <5 . Booom!!! If Distance Player <25 Don't go Booom!!! ;don't kill the messenger. OR: Do a timer! If your rock/Bomb does not get anything in a certain amount of time-it goes booom!! (No matter what) Just like cooking off a missle in other games.
Stuff like that...which is proven to work.




I want this to work almost exactly like the spell effects in the game, except that the "bolt" will travel along the ground instead. The problem: I think I may be able to do collision detection, with a lot of help from this thread, but casting my spell will involve casting a spell on the player, for the script to work. If I am right, though, it will NOT directly cast a spell on the target-at least not one cast be the player, so it may not register as a crime if you go around murdering people in Balmora or Seyda Neen (where's that Fargoth...). If I am wrong about this, please tell me, or if there is another way of doing the bounty so it is close enough to the actual game, please tell me. Also, if someone could please tell me how to make an object fly in a straight line (for the other spell effects), I would be thankful and may even have a few trophies for them.

--------------------
Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)

Nerds rule the world. No one else knows it yet.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | (show all)


Extra information
1 registered and 2 anonymous users are browsing this forum.

Moderator:  Umrahel, Freddo, Pete, Hungry Donner, Attrebus, Miltiades, tegger 

Print Thread

Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 252

Rate this thread
 
Jump to

The Elder Scrolls Homepage

*
UBB.threads™ 6.3

Click for Privacy Statement © 2003 Bethesda Softworks LLC, a ZeniMax Media company. All Rights Reserved.
PRIVACY POLICY | TERMS & CONDITIONS | LEGAL INFORMATION | CONTACT US