RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[GM] Help with items

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 88
I'm scared of my grandma. Wouldn't you be?
Does anyone know how I'd go about having a player be able to use items like in Super Smash Bros. where you can pick them up and throw them in different directions, without having to make a different sprites for a character with every item. Thanks ahead of time.
« Last Edit: March 04, 2014, 01:44:43 AM by modern algebra »

********
Rep:
Level 96
2011 Most Missed Member2010 Zero To Hero
Yes, but I dunno if you could get the bob effect that they have while they're holding it. You would just make it so like...

Say you're player was a square, 32x32. You want to make it so the player can pick up an item, and then carry it around. First, you pick a point. Since it's a featureless square, we'll just make it follow the center.

You'd make it so when button _______ is pressed you activate a variable in the item you're picking up. When that variable is active, it follows the position you decided on. Our position is te center of a 32x32 square, so it would go like this:

player.x+16
player.y+16

NOT RELATIVE

These would go in a 'move to position' action inside the object's step event.

****
Rep:
Level 88
wrath of winter
Somewhere on the GMC is a tutorial for picking up and carrying objects...
nvm the somewhere, I just found it:
http://gmc.yoyogames.com/index.php?showtopic=265987&hl=

look around on there.

Want a personal sig like this? Ask Firerain:
http://rmrk.net/index.php/topic,20203.0.html

**
Rep:
Level 88
I'm scared of my grandma. Wouldn't you be?
Yeah I had already figured that part out...I guess I wasn't very specific. sorry...but I have that part down, but I did it in GML. I put if     "if self.grabbed = 1 {self.x = Player_1.x self.y = Player_1.y}" But the problem is, is when the player goes to pick it up. I have " if collision_point(x,y,Item,false,false) {Item.grabbed = 1} ". This picks up every instance of the object "Item" thats on screen. I know this is because I put "Item.grabbed = 1" rather than "other.grabbed = 1" But when I try that it doesn't pick it up. Thanks for your help so far. I know I wasn't specific enough.  :-\

Edit:Oh thanks icefllame. I'll check it out to see if it's what I'm looking for.
« Last Edit: August 16, 2007, 09:48:21 PM by J-Crew »

****
Rep:
Level 88
wrath of winter
find it useful?  If not you could always PM one of the GM mentors, their links can be found in the Pins under Novice Q&A on the GMC forums.

Want a personal sig like this? Ask Firerain:
http://rmrk.net/index.php/topic,20203.0.html

**
Rep:
Level 88
I'm scared of my grandma. Wouldn't you be?
Yeah it helped alot, sorry I didn't reply sooner. I was busy.