ID:932250
 
Keywords: combine, help
(See the best response by Kaiochao.)
I am makeing a game and i need to make it so that when you put things like combining string with string will make a ball of string. I have no idea where to start the code, can someone give me atleast an example to work with or somthing please?
There are many ways to go about combining items. You need to figure out how you want it to be done, before writing any code.

How do you want the player to combine the string together?
I want them to left click and drag the string onto the other string to make the string ball, after they drop the strings together to tmake hte string ball, i want the string they use to make the ball to dissapear.
In response to Taf71399
Best response
Taf71399 wrote:
left click and drag the string onto the other string to make the string ball,
For this, you want MouseDrop().
after they [make the string ball], i want the string they use to make the ball to dissapear.
For this, you can simply use 'del'.

//  This is the full format of MouseDrop(), given by the DM Reference.
MouseDrop(over_object,src_location,over_location,src_control,over_control,params)
// When you define it under your /.../string object,
// src will always be the string being dragged and dropped.

// You probably want to make sure the string object
// that you're dragging is in your inventory;
// just check src.loc. In mouse procs, usr is always
// the player doing the mouse action.

// When you drop src on top of something,
// that something will be 'over_object'.
// So, just check if 'over_object' is
// another string object.
// Make sure the player didn't drop the string on itself!

// After creating the new string ball (with the 'new' keyword)
// you can simply delete over_object and src
// (in that order; deleting src stops the proc instantly)


If you're serious about requiring the left-click, all you need to do is this:
MouseDrop(...)
// Read up on lists, params, and mouse control
// to understand this.
if(params2list(params)["left"])
// then everything goes here
Thx