Author |
Message |
ramonimbao
Joined: Sat Jan 17, 2009 8:53 am Posts: 79 Location: Philippines
|
[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?
Last edited by ramonimbao on Mon Oct 24, 2011 8:59 am, edited 3 times in total.
|
Thu Oct 20, 2011 5:48 am |
|
|
trystanr
Joined: Sat Oct 09, 2010 10:01 am Posts: 303 Location: Afrique d' Sud
|
Re: Throwable and pickup-able(?) crabs?
Ooh I know! Make a crab skinned grenade! I wonder, can you attach moving attachables?
|
Thu Oct 20, 2011 5:51 am |
|
|
Sims_Doc
Joined: Fri Aug 20, 2010 4:45 am Posts: 911 Location: No Comment.
|
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.
|
Thu Oct 20, 2011 6:20 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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.
|
Thu Oct 20, 2011 5:32 pm |
|
|
maart3n
Joined: Tue Dec 23, 2008 8:04 pm Posts: 1545
|
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.
|
Thu Oct 20, 2011 10:48 pm |
|
|
Mad Alex
Joined: Sat Oct 17, 2009 2:07 pm Posts: 127
|
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.
|
Fri Oct 21, 2011 8:11 am |
|
|
ramonimbao
Joined: Sat Jan 17, 2009 8:53 am Posts: 79 Location: Philippines
|
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?
|
Fri Oct 21, 2011 9:35 am |
|
|
maart3n
Joined: Tue Dec 23, 2008 8:04 pm Posts: 1545
|
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.
|
Fri Oct 21, 2011 10:19 pm |
|
|
ramonimbao
Joined: Sat Jan 17, 2009 8:53 am Posts: 79 Location: Philippines
|
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.
|
Sat Oct 22, 2011 7:37 am |
|
|
Sims_Doc
Joined: Fri Aug 20, 2010 4:45 am Posts: 911 Location: No Comment.
|
Re: Throwable and pickup-able(?) crabs?
if only more people where intressed in this, Personally i love the idea.
|
Sat Oct 22, 2011 6:38 pm |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
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".
|
Sat Oct 22, 2011 9:28 pm |
|
|
ramonimbao
Joined: Sat Jan 17, 2009 8:53 am Posts: 79 Location: Philippines
|
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?
|
Sun Oct 23, 2011 6:51 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
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
|
Sun Oct 23, 2011 7:02 am |
|
|
ramonimbao
Joined: Sat Jan 17, 2009 8:53 am Posts: 79 Location: Philippines
|
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.
|
Sun Oct 23, 2011 12:52 pm |
|
|
Sims_Doc
Joined: Fri Aug 20, 2010 4:45 am Posts: 911 Location: No Comment.
|
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?
|
Sun Oct 23, 2011 7:38 pm |
|
|
|