im new to the svn site, so, how do you download?
im not trying to be dumb or anything.
Could someone tell me the Lua commands to add/take away/modify items?
I want to use this to remove the stereotype that DarkRP is terrible.
like IFAddItem("ammo_pistol", 10) or whatever it is
bumping,for the hellz of it.XD
You can use these to spawn items:
[lua]
item = IF.Items:CreateHeld( "itemtype", pl )
item = IF.Items:CreateInWorld( "itemtype", position, angles )
item = IF.Items:CreateInInv( "itemtype", IF.PlayerInv:GetPlayerInventory( pl ) )
[/lua]
All three functions return an item object.
Check itemforge/items/base_item for all the functions that items have.
Also check out the code in the other items Itemforge has to see how the items work.
The documentation is pretty thorough so you shouldn't have too much trouble figuring things out.
To remove an item you do this:
[lua]
item:Remove()
[/lua]
where item is an item object.
Itemforge is still being worked on, unfortunately I am back in college again... I know, I know.
Mark my words - I WILL finish this project!
As always, I am learning a lot of computer science stuff in college.
The database course I'm taking this semester should be useful for the save/load system when I get around to it.
The new update was nearly finished, but has been put on hold for a little while. This is hardly a full changelist, but some of the major things I've done in the current update:
I fixed a ton of bugs in the current version, one of the major ones being a bug where held items and items in the world could not be interacted with after a lag spike.
Another notable bug that was fixed was where item icons wouldn't update when the item they were displaying was changed.
I also added a lot of functionality that I had always intended to add but hadn't up til now (such as resizing inventory windows).
I redesigned a lot of the systems to use an interface pattern (I studied this in college a couple semesters ago in a software engineering course and it has come in handy).
The UI has benefited a lot from this. Drag-drops use this system now, so now any object (not just panels or entities like it was before) can be draggable, any object can have draggable objects dropped on it, so long as they implement the required functions for the drag interface / drop interface. The benefit here is that people no longer are stuck with my UI. They can design their own custom panels, while still using the same drag/drop system.
I redid the melee weapons, they behave 99.90% like the HL2 melee weapons now. Ammo usage also changed; rather than weapons loading a stack of ammo, now they load ammo source items. The difference is that an ammo source gets to decide if ammo is available, and how ammo is spent (so you could have stuff like batteries or infinite ammo sources).
I was in the process of reworking the ranged weapons, so that any ranged weapon could ask it's ammo how to do something (like, "what do I do when I attack with you?" or "what animation should I play when I attack with you?").
This has not been completed yet, but it's something that's priority for me to get done for this next release.
There are a few other changes to weapons I was thinking of but have not yet begun to work on yet.
One such change would be to move the clips / ammo loading functionality to the base weapon, so any type of weapon could be loaded with ammo (for instance, maybe the stunstick could take a battery or something).
A second change would be to change how the weapon's primary / secondary works. Currently, there's two copies of every weapon event, one for the primary and another for the secondary. I was thinking of just making firemodes that could be assigned to the weapon's primary / secondary, like Fallout 1 and 2 did with their weapons.
For instance, right now the shotgun's primary does a single shot, and the secondary does a double shot. In the new model, "Single" and "Double" would be firemodes, and "Single" would be assigned to primary, while "Double" is assigned to secondary. However, I could also add in a "bludgeon" firemode that lets you use the shotgun like a melee weapon, and then have it so either a seperate key triggers the "Blundgeon" firemode, or so "Bludgeon" can be set to primary / secondary.
Related to the firemodes, I was thinking of letting a weapon use as many cooldown timers as it needed,and letting the firemodes choose which cooldown timer they use (so, for instance, each firemode could have it's own cooldown timer).
Firemodes would also be able to select which cooldown timers they delay, and by how much (so for instance, with the SMG, firing a grenade could delay the grenade cooldown timer a second, and could delay the machine gun cooldown a quarter of a second or so).
These three changes will likely be delayed to a later update so I can get the current one out sooner.
I also planned to get some simple item/inventory saving stuff done, but it takes time!
[QUOTE=theJ89;32483910]You can use these to spawn items:
[lua]
item = IF.Items:CreateHeld( "itemtype", pl )
item = IF.Items:CreateInWorld( "itemtype", position, angles )
item = IF.Items:CreateInInv( "itemtype", IF.PlayerInv:GetPlayerInventory( pl ) )
[/lua]
All three functions return an item object.
Check itemforge/items/base_item for all the functions that items have.
Also check out the code in the other items Itemforge has to see how the items work.
The documentation is pretty thorough so you shouldn't have too much trouble figuring things out.
To remove an item you do this:
[lua]
item:Remove()
[/lua]
where item is an item object.
Itemforge is still being worked on, unfortunately I am back in college again... I know, I know.
Mark my words - I WILL finish this project!
As always, I am learning a lot of computer science stuff in college.
The database course I'm taking this semester should be useful for the save/load system when I get around to it.
The new update was nearly finished, but has been put on hold for a little while. This is hardly a full changelist, but some of the major things I've done in the current update:
I fixed a ton of bugs in the current version, one of the major ones being a bug where held items and items in the world could not be interacted with after a lag spike.
Another notable bug that was fixed was where item icons wouldn't update when the item they were displaying was changed.
I also added a lot of functionality that I had always intended to add but hadn't up til now (such as resizing inventory windows).
I redesigned a lot of the systems to use an interface pattern (I studied this in college a couple semesters ago in a software engineering course and it has come in handy).
The UI has benefited a lot from this. Drag-drops use this system now, so now any object (not just panels or entities like it was before) can be draggable, any object can have draggable objects dropped on it, so long as they implement the required functions for the drag interface / drop interface. The benefit here is that people no longer are stuck with my UI. They can design their own custom panels, while still using the same drag/drop system.
I redid the melee weapons, they behave 99.90% like the HL2 melee weapons now. Ammo usage also changed; rather than weapons loading a stack of ammo, now they load ammo source items. The difference is that an ammo source gets to decide if ammo is available, and how ammo is spent (so you could have stuff like batteries or infinite ammo sources).
I was in the process of reworking the ranged weapons, so that any ranged weapon could ask it's ammo how to do something (like, "what do I do when I attack with you?" or "what animation should I play when I attack with you?").
This has not been completed yet, but it's something that's priority for me to get done for this next release.
There are a few other changes to weapons I was thinking of but have not yet begun to work on yet.
One such change would be to move the clips / ammo loading functionality to the base weapon, so any type of weapon could be loaded with ammo (for instance, maybe the stunstick could take a battery or something).
A second change would be to change how the weapon's primary / secondary works. Currently, there's two copies of every weapon event, one for the primary and another for the secondary. I was thinking of just making firemodes that could be assigned to the weapon's primary / secondary, like Fallout 1 and 2 did with their weapons.
For instance, right now the shotgun's primary does a single shot, and the secondary does a double shot. In the new model, "Single" and "Double" would be firemodes, and "Single" would be assigned to primary, while "Double" is assigned to secondary. However, I could also add in a "bludgeon" firemode that lets you use the shotgun like a melee weapon, and then have it so either a seperate key triggers the "Blundgeon" firemode, or so "Bludgeon" can be set to primary / secondary.
Related to the firemodes, I was thinking of letting a weapon use as many cooldown timers as it needed,and letting the firemodes choose which cooldown timer they use (so, for instance, each firemode could have it's own cooldown timer).
Firemodes would also be able to select which cooldown timers they delay, and by how much (so for instance, with the SMG, firing a grenade could delay the grenade cooldown timer a second, and could delay the machine gun cooldown a quarter of a second or so).
These three changes will likely be delayed to a later update so I can get the current one out sooner.
I also planned to get some simple item/inventory saving stuff done, but it takes time![/QUOTE]
I thought it did save.
Anyway, I will probably modify my RP to spawn using this instead of shipments etc.
A simplified version would be great.
If you could do so i would be very pleased
Sorry, you need to Log In to post a reply to this thread.