Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → IR Goggles
IR Goggles
2005-08-29, 6:06 AM #1
I am trying to make it so that when the player activates the IR Goggles, it will show it on his 3rd person model so others can see. Currently I am using a method that replaces the entire player model with one that has goggles apart of the head, using a ParseArg statement.

The problem here is that when the model changes, its not looking in the direction of the old model until you move it again.

I am wondering if there is a better way to do this instead of making a new goggled player models for each type of skin. I've considered using AmputateJoint or AttachThingtoThing but I'm not really sure whats going on. So, has someone completed this thing before or have any better ideas?
This is retarded, and I mean drooling at the mouth
2005-08-29, 7:06 AM #2
The problem with attachements is, that they completely ignore .key animations. So, if you attach the goggles to the players head in a standing pose, they will float in the air if he goes swimming.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-08-29, 11:51 AM #3
You can use a model swap like you have now. You can attach the goggles as a seperate thing. Or you can use the amputatejoint() method, where you would add the goggles as a new joint to the model. Honestly, for a single addon the model swap makes the most sense.

I'm not sure why you're using parsearg here...since its not synced in multiplayer. Just use setthingmodel() instead.
-El Scorcho

"Its dodgeball time!" -Stormy Waters
2005-08-29, 12:04 PM #4
And it's 200 times easier [and saved space] to make an invisable head and the amputatejoint method.
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2005-08-29, 12:31 PM #5
Originally posted by zagibu:
The problem with attachements is, that they completely ignore .key animations.

Why not make a ghost skeleton of kyle with the gun on it? That is, everything is invisible but the gun. Then just somehow make sure that ghost model plays the same animations at the same time. That I'm not sure how to do...maybe make it an actor so you can align the head pitch easily.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-08-29, 12:40 PM #6
[QUOTE=El Scorcho]the amputatejoint() method, where you would add the goggles as a new joint to the model....

I'm not sure why you're using parsearg here...since its not synced in multiplayer. Just use setthingmodel() instead.[/QUOTE]

How can I ADDjoint? I didnt think there was an opposite verb of amputatejoint.

Is setthingmodel synchronized over the network?
This is retarded, and I mean drooling at the mouth
2005-08-29, 5:51 PM #7
Originally posted by jEDIkIRBY:
And it's 200 times easier [and saved space] to make an invisable head and the amputatejoint method.


It really isn't. It does save file size, but amputatejoint is not synced over the network. Thus you'll have to use sendtrigger to sync, which is pretty tempermental in and of itself. It can be cogged around to make it work, but its hardly a simple feat in comparison to just switching models. If he only has the irgoggles on or off as attached things, it would be a much more trivial task to just use the model swap.

Originally posted by F-Body:
How can I ADDjoint? I didnt think there was an opposite verb of amputatejoint.

Is setthingmodel synchronized over the network?


Follows is a cut and paste on my post from this thread, where I laid out my solution to this problem using amputatejoint(). Setthingmodel is synced over the network.

Background, skip to conclusion if you don't care:
I've worked out a lot of mods in my head, and experimented with a lot of things like this. Hideki originally used a simple attachthing() hack to stick extra grenade belts onto the player. This worked ok for some things, but the players body shifts around and they don't really stick where they're suppose to go.

Well, extrapolating from that I tried to make it so that you could see the players legs in first person by adding a second body to the player and attaching it like HR suggested. Even with MotS playeraction verbs, not all animations can be captured. (and thus duplicated) There's different falling animations or other ones that occur automatically. The effect was pretty close to perfect, but it still had its problems. It was hard to get running to match your speed to begin with, and even more difficult if you had dynamic speed changes. I scrapped it because it was just aesthetics anyway and I was spending a lot of time on it.

Anyway, I wanted to make some different character classes for a midevil mod. One with a shield and sword, another with a bow and arrow. And I wanted the shield and bow and swords to all be present when they were being carried, whether they were carrying them or they were on their back/holstered or whatever.

I'd run into this problem before trying to make akimbo pistols. I thought about using a second model (with an invisible body) attached to the player like with my internal legs idea, but that was imperfect and would be ugly as hell viewed externally. As the body shifted as the player played the landing animation, or rising or anything else I couldn't accurately capture...the second gun/whatever would appear to fly out of his hand as the slight mismatch descrepencies became apparent. Using a second model with the things attached seemed like a good idea (although wasteful from a filesize standpoint) but I'm editing MotS...changed models are reset to the original model after a few seconds, as some sort of halfassed hacker protection in MotS. No go.

Conclusion:
After much musing, I came to the this conclusion. I have NOT tested this yet, so its still a theory. But I don't see any reason why it shouldn't work. The best way to 'add things to the player' was to not to try and 'add them' to the player. The best way was to start with all, and then REMOVE the ones you don't have. Because there's already functionality built in to allow us to do that!

Add all possible things that could be attached to the player (a second pistol, a holstered pistol on each leg, or a bow in his left hand and a bow on his back) to the model as new nodes, set them as new joints and use amputatejoint to remove the ones you don't want.

Lag? I can beat that I think. Use thing flags on the player. 0x100000000 is has bow. 0x20000000000 is has bow in hand. When you originally get the bow out, send trigger to master cog that runs locally on all machines. Cog checks the thingflags, resets the model and 'reverse builds' the appropriate one based on the set of thingflags. All done locally. Amputate joint is NOT synced so they has to be done locally anyway. MotS model protection is defeated because we ARE using the original model still!

Dropped packact protection is cake from there, all players are added to an array at join, removed at leave. Every 5 seconds or so, the array just checks the relevant thing flags of all things in the array against their old values. If they've changed, it just executes the code that sendtrigger should have already done and corrects the error.

The only things that might throw a monkey wrench into the plan...Is there a limit on the number of joints that can be defined in a 3do? My original plans for this usually involved characters that would only be carrying a couple weapons anyway, so I wasn' t that concerned. But if there is a limit, it might be met easily by adding lots of weapons.

Also, its a bit of a pain to code, and its a pain for the player models since you have to edit them (you'll have some ugly models with weapons stuck all over them)...but it should look totally seemless in game. The use of sendtrigger and a local thingflag checker cog should add virtually no lag to the game while maintaining accurate handling.

Let me know what you think? I can't always see the potential problems.
-El Scorcho

"Its dodgeball time!" -Stormy Waters
2005-08-29, 8:27 PM #8
Theorhetically it's all sound, actually implementing would take some work. Really well laid out; my only suggestion would be to just use the GetPlayerCount() and GetPlayerThing() verbs instead of an array based on joins/leaves to monitor players. My guess would be the array would keep the flag values between checks watching for changes, so I suppose an array would be necessary, I'd just use the GetPlayerX() verbs to update the array rather than join and leave messages.

QM

↑ Up to the top!