Game Development Community

Replace object with another when using item?

by Charlie Higdon · in Technical Issues · 06/06/2008 (10:18 am) · 3 replies

I've had such a mess (probably because i'm a moron) with mounting an object to another.

Originally I was trying to pick up ItemA and add it to my inventory (which worked). Then I wanted to be able to use ItemA and have it go away from my inventory (which worked). I then wanted it to mount to an ObjectB, which never would work. In particular, I wanted it to mount to any of the ObjectB that I happened to be targeting at the time. I did manage to make it disappear from inventory and reappear at the ObjectB location, but only as an item which I could then pick up again (bascially throwing the thing).

Then I happened to wonder if I could replace the ObjectB I was targeting, with ObjectC which looked the same as the ObjectB, but with the "item" already mounted.

Is it possible to replace a shape like that? Delete the existing shape upon using an item and replace it with another. I'm not trying to make a damage model or anything like that.

#1
06/06/2008 (10:52 am)
I would suggest looking into the Platforms the Players can Ride thread (it's named something like that), it has some dynamic attachment code that you could use to mount ObjectA to a node on ObjectB.
#2
06/11/2008 (8:34 pm)
So far haven't been able to make anything out of the platform code.

I did come up with another idea I think might work, but it presents yet another thing i'm not sure if it's possible.

Can you have a weapon only damage one specific staticshape and nothing else?
#3
06/15/2008 (11:50 pm)
Scratch that idea then, maybe another way I can do what i need...

Possible to just place an item where I am looking, I know you can do it in tribes with the cameras, satchel packs, some turrets. They placed on the ground or on walls, which walls would work great for my idea. They never mounted to vehicles or players, which again is perfect.

A raycast to check if I'm hitting players or vehicles when I try to "use" the item, and if not then it would stick to the wall or whatnot? That wouldn't require a building with a mountpoint right?

Is that doable through script alone?