- Joined
- May 21, 2011
- Messages
- 31
I've been trying to construct a simple backpacking system that will store items in one bank, for all players. So any player can put in, and player can take out.
It works by indexing the items, BP_Times + 1, Save item type as Item_Type[BP_Times]. Then unpacking is setting P[0] to position of casting unit, for loop BP, from 1 to BP_Times. Create one Item_Type[BP] at P[0]. Then destroying the point. For some reason unloading causes unit lag (The unit will not play another action until it finishes whatever it was doing).
Here are the triggers
As you can see, VERY simple triggers. They work out fine, just cause lag. I really don't want to do hash tables unless I have to.
Thanks in advance.
It works by indexing the items, BP_Times + 1, Save item type as Item_Type[BP_Times]. Then unpacking is setting P[0] to position of casting unit, for loop BP, from 1 to BP_Times. Create one Item_Type[BP] at P[0]. Then destroying the point. For some reason unloading causes unit lag (The unit will not play another action until it finishes whatever it was doing).
Here are the triggers
Pack
-
Pack
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Pack
-
Actions
- Set BP_Times = (BP_Times + 1)
- Set BP_Save[BP_Times] = (Item-type of (Target item of ability being cast))
- Item - Remove (Target item of ability being cast)
-
Events
Unpack
-
Unpack
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Unpack
-
Actions
- Set P[0] = (Position of (Casting unit))
-
For each (Integer BP) from 1 to BP_Times, do (Actions)
-
Loop - Actions
- Item - Create BP_Save[BP] at P[0]
-
Loop - Actions
- Set BP_Times = 0
- Custom script: call RemoveLocation(udg_P[0])
-
Events
Thanks in advance.