Data Realms Fan Forums
http://45.55.195.193/

[SOLVED] Throwable and pickup-able(?) crabs?
http://45.55.195.193/viewtopic.php?f=1&t=25932
Page 1 of 2

Author:  ramonimbao [ Thu Oct 20, 2011 5:48 am ]
Post subject:  [SOLVED] Throwable and pickup-able(?) crabs?

How would I go about making a crab you can pick up and throw?

Also, would it be possible to buy a crab as part of your weapons and not as an actor?

Author:  trystanr [ Thu Oct 20, 2011 5:51 am ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Ooh I know!
Make a crab skinned grenade!
I wonder, can you attach moving attachables?

Author:  Sims_Doc [ Thu Oct 20, 2011 6:20 am ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

intressing idea picking up units, then you could have smaller units jump onto the back of a large unit to destroy them control a backpack turret.

Author:  Roast Veg [ Thu Oct 20, 2011 5:32 pm ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

You could have a throwable object that gibbed into a crab, and returned to throwable object status when a human gets too close.

Author:  maart3n [ Thu Oct 20, 2011 10:48 pm ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Can't you connect a trowable object to the crab, just like the dropship turrets? Although I'm not sure how that would work in combination with putting them in your inventory. I think the best idea would be Roast's.

Author:  Mad Alex [ Fri Oct 21, 2011 8:11 am ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Actually you can put Actors in your inventory and even hold them in hands. Script that would attach a HeldDevice to ACrab and on picking it up would delete it and add the ACrab to inventory instead will do the work, I think.

Author:  ramonimbao [ Fri Oct 21, 2011 9:35 am ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Okay, so far, so good. I did a grenade-skinned crab, with a crab pinned to it.
Only problem is, it gibs in the actor's hands (because the crab pinned to the grenade collides with the actor).
If anyone knows how to make it not collide with the actor if he's holding it, it would be great.

Also, it gibs by itself (because it collides with itself) if ever I use HitsMOs = 1 and/or GetsHitByMOs = 1. Now the problem is, if I put both of them as zero, I am not able to pick them up.

Any help?

Attachments:
BuyCrab.rte.zip [1.07 KiB]
Downloaded 187 times

Author:  maart3n [ Fri Oct 21, 2011 10:19 pm ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Can't you detect if an actor is holding it? If so you could set it to not hitting when held.

Author:  ramonimbao [ Sat Oct 22, 2011 7:37 am ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

maart3n wrote:
Can't you detect if an actor is holding it? If so you could set it to not hitting when held.
I don't know how to translate that into code.

Author:  Sims_Doc [ Sat Oct 22, 2011 6:38 pm ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

if only more people where intressed in this, Personally i love the idea.

Author:  Asklar [ Sat Oct 22, 2011 9:28 pm ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Well, there is this SetWhichMONotToHit thing, but I wouldn't know how to properly use it in this case.

And Sims_Doc, posting that isn't helping either. If you were really interested in this, you could have done something as basic as look for info., just what I did. And you don't need to be a master coder to get into the wiki and type "not hit".

Author:  ramonimbao [ Sun Oct 23, 2011 6:51 am ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Thanks for that function Asklar!

In the previous version, the crabs were quite fragile and explosive. A little bit of movement would make the grenade portion of the crab get deleted. Fixed it now by setting the mass of the grenade to zero.

I don't know how you can detect if an actor is holding the item via the item itself.

Also if you buy a weapon along with this, switch to this and then switch back, the ACrab created by the grenade stays there and doesn't get deleted (even if I set the ACrab to ToDelete = true in the Destory function).

Any help?

Attachments:
BuyCrab.rte.zip [1.19 KiB]
Downloaded 172 times

Author:  Asklar [ Sun Oct 23, 2011 7:02 am ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Ok so, I tested it and the actor started moving wierdly and the crab began gibbing.

The way I can think of detecting if the item is held would be:
1) Detecting the parent of the item.
2) if parent.EquippedItem.PresetName == "Buyable Crab" then

Author:  ramonimbao [ Sun Oct 23, 2011 12:52 pm ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Okay, now it seems that the LEGS of the crab are colliding with the actor. Would you happen to know how to point to the legs of the crab?
Not too familiar with this, but would one way be to go through all the MOs and finding all the ones with that are the same as the ID of the ACrab created? (Also would that be laggy because it goes through all the MOs every frame?)
Also, the problem with crab staying there even after you switch to a weapon is still there. It seems that the check for whether the parent's equipped item does not happen simply because when the crab gets switched, it stops existing (or something like it).

EDIT: Fixed the crab not disappearing when switching to another weapon by making a copy of the crab and applying a script to it. Booyah!
The problem with the legs still colliding with the actor is still there, though.
Also, if somehow the crab gets gibbed while the actor is still holding it, a crab won't respawn immediately and you have to switch back and forth between it.

EDIT2: Okay, weird. It got fixed with one crab, but with multiple crabs around, it doesn't seem to work.
EDIT3: Okay, very weird. Now it doesn't work.

Attachments:
BuyCrab.rte.zip [1.67 KiB]
Downloaded 160 times

Author:  Sims_Doc [ Sun Oct 23, 2011 7:38 pm ]
Post subject:  Re: Throwable and pickup-able(?) crabs?

Asklar wrote:
And Sims_Doc, posting that isn't helping either. If you were really interested in this, you could have done something as basic as look for info., just what I did. And you don't need to be a master coder to get into the wiki and type "not hit".

Who Else Would Keep morale up?

Page 1 of 2 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/