REQ Special Script Ressource

Post » Fri May 27, 2011 4:10 am

I have a request for a script, with which you can place an NPC on top of different vehicles for transportation issues. I can make various vehicles and animate them, but I always have the problem, that player won't stay on top, cause position has to be scripted. Couldn't one of you experienced scripters make such a script as ressource for the community. So if anyone makes a vehicle, he'd just need that script and adjust the x,y,z coordinates to make them match his own model. :)


TheDaywalker :rock:
User avatar
Lizzie
 
Posts: 3476
Joined: Sun Nov 19, 2006 5:51 am

Post » Fri May 27, 2011 10:18 am

Are you PCs not standing on top also in the third person view?

Activator (vehicle) might have collision structures (RootCollisionNode branch), than PC/NPC will stand on it.
In some cases even that is not necessary (MW engine creates them): case with my elevator.
You are able to script your vehicle, right? PC/NPC should be scripted in the similar way.

There is a cinematic script example in MWSfD, check it. Few mods have some sort of vehicles, check their solutions.

:)
User avatar
Krystal Wilson
 
Posts: 3450
Joined: Wed Jan 17, 2007 9:40 am

Post » Fri May 27, 2011 7:53 am

I could write a script that keeps the pc or an npc in position on an object, but if the object is animated as opposed to scripted I have found there could be the problem that the the pc wouldnt move as the x,y and z coordinates of an animated object wouldn't actually change, it just appears to be moving because of the animation... if you get what I mean...

I have a request for a script, with which you can place an NPC on top of different vehicles for transportation issues. I can make various vehicles and animate them, but I always have the problem, that player won't stay on top, cause position has to be scripted. Couldn't one of you experienced scripters make such a script as ressource for the community. So if anyone makes a vehicle, he'd just need that script and adjust the x,y,z coordinates to make them match his own model. :)


TheDaywalker :rock:

User avatar
Trent Theriot
 
Posts: 3395
Joined: Sat Oct 13, 2007 3:37 am

Post » Fri May 27, 2011 7:36 am

the pc wouldnt move as the x,y and z coordinates of an animated object wouldn't actually change, it just appears to be moving because of the animation


Are you sure? That's very interesting. In general there are two main ways of animating PC/NPC/creatures in games: 1. animation (e.g. walking, running) is happening on the spot, no translations clamp, and game engine takes care of that (actual movement in game space). This is an effective from the programming point of view solution that is often used in MMOs, but it has problems with precise detection of terrain collisions; 2. walking/running, etc animation files contain x,y,z clamped translations (game engine executes only a loop(s) of a particular sequence.
MW walking/running/jumping animation files contain flagged with clamp translation loops (the model is not just rotating leg bones remaining on the same place). Hence, I thought that MW uses the second variant and has therefore better terrain collision detection.

:)
User avatar
Emilie Joseph
 
Posts: 3387
Joined: Thu Mar 15, 2007 6:28 am

Post » Fri May 27, 2011 4:45 am

If you animate an elevator,the player will be lifted up automatically through collision of the elevator platform, but if movement goes on x,y-axis, player will stand in place and platform will slip away right under your feet. Even collisions to the sides get ignored completely. So what is needed to make a player remain position on a moving object is:

A script that makes the platform move and updates the players coordinates synchron to its own movement. Other possibility, platform is animated and script let's the player move in same direction with equal speed. I could just steal some riding scripts, but as I have no clue of scripting at all, I wouldn't even be able to alter them for my needs!!!

EDIT: I know what you mean Chainy, you can't check coordinates of an animated object frame by frame, but you can tweak speed and movement of the player to match the animation.


TheDaywalker :rock:
User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am

Post » Fri May 27, 2011 7:47 am

I see, indeed, I have tested only z direction. I am not a great scripter either: I have a huge problem now with a similar task ? positioning an NPC close to a PC facing him/her. The idea is to replace one of the idles with walking sequence (PlayGroup/LoopGroup functions are not working for me). So NPC could come close to PC. But I have totally forgotten geometry and not able to script angles (PC facing angle and corresponding NPC movement direction) correctly. That would be great if anybody could help with this generic (IMHO) script.

Qarl's "Underground2" has platforms that are moving in x,y directions without problems.

:)
User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Thu May 26, 2011 11:32 pm

I just recently saw a thread with a flying ship here, maybe the author will let me use a part of his script for my vehicles. What was the guy's name again...??? :wacko:

IIRC somebody had already scripted NPCs kissing the player, wasn't it Fliggerty?! Maybe you could have a look at how that had been done, don't know the mod's name though.

PS: In my german forum we have a sticky script-thread and it is very usefull, we should have such a thread here too, instead of having to ask the same questions and requests again and again!!! :(


TheDaywalker :rock:
User avatar
Jessica Colville
 
Posts: 3349
Joined: Wed Oct 18, 2006 6:53 pm

Post » Fri May 27, 2011 4:24 am

There are several variants of kissing/hugging scripts, e.g.: Qarl's with PlayGroup/LoopGroup; Emma's with levitation spells. Unfortunately, I am not able to incorporate them properly in the companion script (I am adopting Grumpy's Companion_v3.1 project). Now I have a headache with scripting a dancing option.

Well, it's a great shame for me to admit that my German writing after many years of not talking German at all is awful, but could you post a link to this forum?

:)
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Fri May 27, 2011 8:58 am

I just recently saw a thread with a flying ship here, maybe the author will let me use a part of his script for my vehicles. What was the guy's name again...??? :wacko:


It was iio: http://www.gamesas.com/bgsforums/index.php?showtopic=1020309&view=findpost&p=15421367
Though the ship's movements are controlled through scripts, so this wouldn't work for you.

Chainy is correct, because the game can't detect the x,y,z coordinates of the animated nodes in your .nif, only the model's center (the root bone), as the movement is controlled by the .nif and not the game, it is difficult to place the player on the vehicle through scripting, without clever animation. If it was a creature that followed a pathgrid or was controllable by the player, it would be easier to attach the player to it using existing scripts.

Can bounding boxes on animated activators push the character (I know standard collision can't)? If so, a 'collision cage' could be made to keep the chracter in.
User avatar
Baby K(:
 
Posts: 3395
Joined: Thu Nov 09, 2006 9:07 pm

Post » Fri May 27, 2011 9:16 am

because the game can't detect the x,y,z coordinates of the animated nodes in your .nif, only the model's center (the root bone), as the movement is controlled by the .nif and not the game


Well, do you have supportive facts for that statement?

My PC was able to walk around on Qarl's platform when it was moving forward.

I was (game engine animation control) basically shortly describing Gamebryo programming e-book that was released some times ago on their website.

:)
User avatar
Big mike
 
Posts: 3423
Joined: Fri Sep 21, 2007 6:38 pm

Post » Thu May 26, 2011 11:14 pm

I'm talking about scripting, not about the game engine, and I can't find any scripting function which could be used to detect individual nodes in a mesh myself.

What I mean is that the game can detect where a model is as a whole but not where a part of the model is (such as an animated node or NiTriShape) through scripts.
I assumed this was the problem here as TheDayWalker is making a http://www.youtube.com/watch?v=ps-WNjtXb_E.
If the movement is controlled through the game (through scripts) you can apply the same movements to multiple objects easily.

An example and supportive fact of what I mean, is that the game can detect where your player is using the object's center (which I know can be changed through root bone animation in creatures) through script (PlaceAtMe, GetDistance, GetAngle etc.), but it can't detect the position of your person's arm. It's the same with activators, you can detect the model's center but not it's individual animated nodes.

I haven't played the underground 2, but if you give me the platform's ID in the game, I'll take a look at it to see if it helps. Can you move around on these platforms too?
If so it might use something I'm unaware of, most platforms use scripted movements on a non-animated mesh, which is the best way to do it from what I've seen (player can move freely on mesh).

TheDayWalker, you could try splitting the cables and ship into 2 meshes, and see if detecting where the ship mesh goes works then.
Alternatively, if the cable ship just move straight you could get someone to script the movements of the ship.
User avatar
Shelby Huffman
 
Posts: 3454
Joined: Wed Aug 08, 2007 11:06 am

Post » Fri May 27, 2011 6:32 am

The cables are a single object yet. I just need a "simple" positioning script, which has been done already dozens of times for sailable ships and such. I will search the forum, there is a thread with a video from some weeks ago, where a mod has exactly that feature!!! :)

EDIT: You can detect a position inside a mesh by using special bones, like weapon bone, shield bone etc., but Morrowind has no bone for riding or positioning on object issues like Oblivion has. Would be interesting, if we could convert a riding bone to Morrowind or build a custom one. Maybe Morrowind game engine can handle it and they had only not forseen to have rideable creatures in the game.


TheDaywalker:rock:
User avatar
Lindsay Dunn
 
Posts: 3247
Joined: Sun Sep 10, 2006 9:34 am

Post » Fri May 27, 2011 6:53 am

I linked to the sailable ship above, but I also said, it DOES NOT use animated .nifs.

They are moved through script ALONE, no animation in the .nifs at all. This means you can just move the character by attaching the same movement scripts.
This is how all sailable boat scripts I've seen do it, using the http://www.uesp.net/wiki/Tes3Mod:Move IIRC.
I thought this was how platforms would be done too, but I'll have to check this platform Axel is talking about, and see if I can help out.
Ask iio. That's why I said you could get someone to script the movement of the cable ship instead of animating it.

If you have animated the .nif, it's difficult to place the character onto the mesh. You might be able to use placeatme, or something similar to riding scripts, but then your character can't move while you ride it.
You cannot detect the position inside a mesh using special bones USING SCRIPT, which is the point I'm getting across here.
Adding a new bone would do nothing, as you wont be able to detect it's coordinates in your scripts, just as you can't detect the coordinates of a weapon or shield bone.

I'm really, really sorry for the capitals, I don't want to sound rude, but I just want to get the important parts across. :)
edit: I also want to say that my knowledge in scripting is not that great, I'm more of a modeller/animator, so I may be wrong about some of this, in which case I'm sorry, but I'm contributing to the discussion, and just trying to help out with what knowledge I do have.

Great job on Ald-ruhn btw, I look forward to playing it. :D
User avatar
Maddy Paul
 
Posts: 3430
Joined: Wed Feb 14, 2007 4:20 pm

Post » Fri May 27, 2011 6:56 am

What I mean is that the game can detect where a model is as a whole but not where a part of the model is (such as an animated node or NiTriShape) through scripts.


I also think so. But in case of a PC/NPC/creature for what do we need to have scripting access to individual bones in order to detect/script position of a model as a whole that is sufficient to keep them standing on a moving platform. In case of an animated activator (platform, ship, etc. with or without nif collisions) it will be definitely easier to animate it solely with scripts and check how PC/NPC will behave standing on it (my z-elevator is animated within the nif).
I have a feeling that we are going to reinvent a wheel, but for us that would be a great discovery (I need an x/y-moving platform for a mod project that is on hold at the moment).
I do not have Underground2 installed now.
I am fine with the tone of our discussion.

:)
User avatar
Justin
 
Posts: 3409
Joined: Sun Sep 23, 2007 12:32 am


Return to III - Morrowind