Jump to content

Spawn an item at a certain location?


Salk

Recommended Posts

Well, I noticed that the container added by the EE has the "EE: Don't clear" (6) flag, which I cannot obviously set for the classic game.

Does anyone know what happens if I proceed without it?

I found an example in the WeiDu documenation about how to add a container to an .ARE file but I am a bit confused by some of the required parameters:

INT_VAR fj_loc_x to the X coordinate

INT_VAR fj_loc_y to the Y coordinate

INT_VAR fj_trap_loc_x to the trap launch X coordinate

INT_VAR fj_trap_loc_y to the trap launch Y coordinate

What's the difference betwee the first set of X, Y coordinates and the second one?

Thanks!

Edited by Salk
Link to comment
13 hours ago, Salk said:

@Daulmakan,

thanks for the advice. If I cannot find a way to go for the best solution (see above), then I guess I could follow your advice but the item is not magical. The current flags are: droppable (2), displayable (3) and not copyable (5).

I want to make it a plot item so that it wouldn't disappear if spawned but at the same time, for narrative reasons, it cannot be made unsellable. So perhaps there is no possibility this way. 

Try this one, then:

COPY_EXISTING ~ITEM.itm~ ~override~
 WRITE_SHORT 0x18 45
BUT_ONLY

Is it a vanilla item or not?

Link to comment
8 hours ago, Salk said:

Well, I noticed that the container added by the EE has the "EE: Don't clear" (6) flag, which I cannot obviously set for the classic game.

Does anyone know what happens if I proceed without it?

I found an example in the WeiDu documenation about how to add a container to an .ARE file but I am a bit confused by some of the required parameters:

INT_VAR fj_loc_x to the X coordinate

INT_VAR fj_loc_y to the Y coordinate

INT_VAR fj_trap_loc_x to the trap launch X coordinate

INT_VAR fj_trap_loc_y to the trap launch Y coordinate

What's the difference betwee the first set of X, Y coordinates and the second one?

Thanks!

You can just use a macro to add your item to a container:

COPY_EXISTING ~ARXXXX.are~   ~override~
  PATCH_IF SOURCE_SIZE > 0x28f BEGIN
    LAUNCH_PATCH_FUNCTION ADD_AREA_ITEM
      INT_VAR container_to_add_to = 1 // LOOK FOR THIS NUMBER IN INFINITY EXPLORER or NEAR INFINITY
      STR_VAR item_to_add = ITEM      // Your item name without the .itm extension, so it needs to exist already in the game or in override before doing this
    END
  END
BUT_ONLY

 

Edited by Daulmakan
Link to comment

Hello, Daulmakan!

8 hours ago, Daulmakan said:

Is it a vanilla item or not?

It's a duplicate of a vanilla item (AMUL13.ITM).

I created a container and put it into it so perhaps I don't need to add any additional flag to this duplicate item of mine?

Link to comment

To Salk: forget containers. What you need is an invisible minion - a creature without an animation or foot circle and a script that says

DropInventory()
DestroySelf()

Then spawn it through the area script or whatever other script you use.

 

Link to comment

Nope. Was that said here somewhere? I glanced down the discussion and the minion drop method was not mentioned for anything. Instead the talk veered off to realms remote and awkward. In my opinion, Salk should curve his expectations a little and either give the crucial item in another way than throwing it on the ground or accept that it might not be found. This engine has limitations, to say the least.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...