• 🏆 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!

need a spell done

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Asking for one to be made is the request fourm job I think. . .
This is for help making spells.
A weapon system is about the easiest thing to make. . .

There are 2 Ways you can make one.

The Cube Method
You make 2 integer arrays and you store the shield items handle nums in one and weapons in the other.
Additonal ones can be added for more types.
You need to make it so that when a hero picks up an item it runs a check system for both the armor and weapon.
The check system loops for each item slot a hero has checking if the item carried by it is contained in the variable.
The reason this is called (more like I called it) the Cube Method is that is the way it works is simlar to finding the area of a cube it can also be reffered to as a 3D item system method.

If we had 25 in 3 catergies it would work like this.
3*6*25 Which means it will search for items 450 times.

There are many ups and downs to this method.
+ Easy to make
+ Easy to modify
+ Vitualy unlimated item capicity
- With lots of items will cause HORIABLE lag.
+ Unlike most systems seen in MP maps will not bug as much
- No support of class only items without going into a 4D system resulting in more lag
- No support of level restriced items without going into a 4D+ system resulting in even worse lag

The SMART method
You store every item in a gamecahe with a string under the items handle integer.
You then make a string encoder that can make a string system like ill show below.
You can retrieve the string by simply geting the item type integer and fetching the string from the game chache then running the string through a decoder and calling the corosponding actions.
When a unit picks up an item it will loop threw the inventory and if it finds 2 weapons one will be dropped.

Hers an example of the string you could store with the items.
WA005L
The W could stand for weapon the A for archer class only the 005 for level usuable and the L for what pioroity to drop if there are 2 weapons.

There are many ups and downs to this method.
- VERY hard to make for beginners
+ Supports vitualy anything imaginable from an inventory system.
- Might lag if you over do it
+ Good reliable system that will not bug easily.

Thses are a rough guid line how to go about making an item system.
If you are interested in any of the above just say and ill tell you what to do in more detial.
 
Status
Not open for further replies.
Top