Page 1 of 1

The art of looting

Posted: March 17th, 2012, 5:06 am
by Wildhawk92
I have followed the rpg tutorial on wikipedia and it mentions somewhere in there that 4 is the default for looting...

If the tutorial explained this a bit better it would be helpful, obviously (in fact, if it outlined the scripting for looting - which you think it would do, hello rpg stereotype!- that would be helpful)

So, basically, if you have any good scripts for looting just let me know and tell me exactly how/where/which folders to save them in. I'm sure many others would also apprieciate this :)

Re: The art of looting

Posted: March 19th, 2012, 11:21 am
by kddekadenz
I implemented looting in Kelgar, but it's done in a rather bad way.
Hirato is working on selling, buying and looting I think.

Re: The art of looting

Posted: March 27th, 2012, 6:33 am
by ryanevans1
If the tutorial explained this a bit better it would be helpful, obviously (in fact, if it outlined the scripting for looting - which you think it would do, hello rpg stereotype!- that would be helpful)

EDIT BY MODERATOR: Links to outside game(s) removed. Please do not spam.

Re: The art of looting

Posted: March 27th, 2012, 1:19 pm
by tyche
ryanevens1,

Just for your information: the three links in your last post are for another game, not associated with Sandbox. In addition, I got a report on you that you are listed as being associated with spamming in connection with your email address, your IP address, and your user name. Now, so far, except for those three links (which I am removing) you seem to have some interest in Sandbox. As long as it stays that way you're welcome to stay. However, if I see any more spam you'll be gone so fast that it'll leave skid marks.

Craig A. Eddy (Tyche)
Forum Moderator

Re: The art of looting

Posted: March 27th, 2012, 6:39 pm
by Sircameron
Check the "//papyrus" script in the rpg tutorial for a basic idea of pickup/looting.. Now imagine doing that for every "lootable" item.. Thats why no one had produced a script for it.. Why go through all that when you can wait until its fully implemented? Id have no problem writing and posting a "looting" script if i knew for a fact that it wouldnt be implemented for a long time.. But the best thing to do is wait til its added to the source code that way its faster, less chance for bugs/glitches, and far less tedious to add/edit.. Im sure it was fun and exciting to do for kelgar ;D

Re: The art of looting

Posted: March 27th, 2012, 10:14 pm
by Hirato
The easiest way to implement looting would be to override the "loot" script slot for NPCs and containers. I've not done it yet since I want it done probably with GUIs and stuff (and of course with the ability for the player to dump his items onto the container in turn.
I've had precious little time as of late but I have been working on a few things when I can... It's quite possible for the RPG to enter beta sometime within the next two released.

In any case... The papyrus example in the tutorial was for a (one time) harvestable plant. The example would work better if its inventory respawned after a set period of time. but in hindsight, I suppose I could've simply dropped a few item entities to achieve it, but this has other ramifications too, such as the model for the harvested papyrus being completely different.
Not to mention using the trigger makes it much easier to add other conditions before you'll be able to pickup or harvest the item.

a basic looting script for pretty much anything... I'll eventually get around to a proper looting GUI and an r_transfer command.
Do note this won't get equipped items.

Code: Select all

r_script_signal "loot" [
    r_loop_inv item self [
        r_additem actor (r_get_base item) (r_get_quantity item)
        r_remove self (r_get_base item) (r_get_quantity item)
    ]
]