• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

when items are dropped on ground they can be seen

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
its a single player rpg so the leaking might not be that big of a deal. though im not sure. input?
Letting it leak will mean that dropping the items could be used as a way of permanently revealing the map. Additionally if players were to pickup and drop the item repeatedly there may be a decrease in game performance.

I would suggest a simple system that keeps track of key items and creates visibility modifiers when the item is dropped and removes them when it is picked up. This could consist of an item array, a visibility modifier (I forget the type name) array and an integer to keep track of item count. When you create a key item you add it to the item array at the count index and increment count index by 1. When an item is dropped you iterate through the item array up to count index and if it matches the manipulated item then create a visibility modifier and assign it to the same index in the visibility modifier array. When an item is picked up iterate through the item array up to count index and if it matches the manipulated item then destroy the accompanying visibility modifier.

Remember to make the items invulnerable. It would be silly making such a system just to have the player accidently kill the item.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
its so weird that i cant just use show item when a unit loses an item.
But the item is not hidden... Sure it is not visible but it still is not hidden. Show item goes with hide item which function similar to show/hide unit. Hiding an object deregisters it with the actor system and the spatial systems. An object that is not visible to a player is still registered with both.

In StarCraft II items are units so you could just make the unit owned by the dropping player and give it a line of sight and get exactly the mechanics you want.
 
Status
Not open for further replies.
Top