Why not just the stack size of the thrown/fired/slung/ item, and just return a certain number of them when the combat is over?
RE: Thrown Weapons - Is This Possible?
Débuté par
Pstemarie
, févr. 09 2013 03:31
#26
Posté 13 février 2013 - 06:05
#27
Posté 18 février 2013 - 04:32
In this case you could take advantage of the NPC AI to determine actual amounts. In the OnAttacked simply set a local int(one time per object ID) and a local object(one time per object ID) on the /*EDIT=Should probably be set on the area to keep track of the ammuntion being used on multiple NPCs with it reading each NPCs object ID as well*/NPC that tells them how many they started with and gives them the chance to determine if that object has been destroyed. Then in the OnDamaged event increment a local int by 1 each time they're hit. Then when it comes time for this NPC to die have them take the amount of things you started with and subtract by the amount they have now and then subtract by the local int of number of hits to get the number of misses. Create the missed ones in random locations nearby and the hit ones on the NPC and you're good. It involves using 3 events, but because the events have little code involved it isn't too taxing.
EDIT= MATHS!
[(number they started with{per object ID}-number they have{if different object ID then assume previous stack completely used if local object comes up invalid})-number of hits] = Ammunition created in random locations away from the body.
number of hits(per object ID) = Ammuntion created on the body.
EDIT= MATHS!
[(number they started with{per object ID}-number they have{if different object ID then assume previous stack completely used if local object comes up invalid})-number of hits] = Ammunition created in random locations away from the body.
number of hits(per object ID) = Ammuntion created on the body.
Modifié par Highv Priest, 18 février 2013 - 04:40 .
#28
Posté 18 février 2013 - 03:21
Yeah, something like that. I think I would just do a simple on unacquire and have a % chance, for all thrown or ranged weapons, to survive: bullets, arrows, bolts, 50% chance: darts, axes, bolts, 80%and then then re-create them after a time back in the PC's inventory. Less verisimilitude. Howsoever with any system where things are on the ground or nearby after being fired, why would it be limited to only PC items? Thus: is everything fired by anyone recoverable? I think not. For expedience no one would do that, but that would be more realistic. My approach is less realistic but the idea is the PC recovers part of the fired ammunition over time.
Oh and instead of creating each individual bolt, arrow, etc.. you just keep a running total that ticks up everytime a ranged weapon is used and adds the number to an int if the % chance of survival is met. So say you fire 10 arrows and get 5 back, and after recreation the int resets to 0. The only difficulty I see would be worlds with many types of arrows, bolts, etc... then you have to make an int for each individual type, which would be tedious, Of course flaming arrows don't survive, or you could just have all elemental arrows default to +1 arrows, they lost their elemental magic when they hit. One approach.
Oh and instead of creating each individual bolt, arrow, etc.. you just keep a running total that ticks up everytime a ranged weapon is used and adds the number to an int if the % chance of survival is met. So say you fire 10 arrows and get 5 back, and after recreation the int resets to 0. The only difficulty I see would be worlds with many types of arrows, bolts, etc... then you have to make an int for each individual type, which would be tedious, Of course flaming arrows don't survive, or you could just have all elemental arrows default to +1 arrows, they lost their elemental magic when they hit. One approach.
Modifié par ffbj, 18 février 2013 - 03:29 .
#29
Posté 18 février 2013 - 06:41
The OnUnAcquire event does not trigger when a stack is reduced, only when you receive the message "you have lost <insert name of item>". My method is exceptionally realistic and you could incorporate percentages based on the materials of your ranged items to determine how many of them are actually dropped from misses and hits. Players DO appreciate extremely realistic things in games if it actually has a fundamental point behind it and doesn't just add "flavor" or make the game less fun. In this instance it's a realistic method of retrieving SOME of your ammo similarly to the designs of Skyrim. A long while ago I started occasionally giving my "uber bosses" personalities and the players loved it. Even now the name "Jack O' Lantern" strikes fear upon anyone on my server to have witness him.(imagine a boss that -enjoys- watching you fail and laughs when you do and not only that but will kill you in different ways just for the fun of it) His laugh is the cheer for Karlat "Ahahahahahaha!". Players LOVE fighting Jack O' Lantern because they WANT to see him die. They want the satisfaction of knowing they defeated a geniune monster of a being instead of just some guy.
Modifié par Highv Priest, 18 février 2013 - 06:43 .
#30
Posté 18 février 2013 - 10:01
Oh yeah that's correct stack has to be entirely gone. Just as well I think it would be too messy anyway. I know it's like Skyrim which is an ok way to do it.
Yeah I am all into realism too, as long as it is not too much at the expense of playability.
Yeah I am all into realism too, as long as it is not too much at the expense of playability.
#31
Posté 19 février 2013 - 01:14
Is the recovery idea just for creature combat or also bashing?
#32
Posté 20 février 2013 - 12:49
It would work in bashing too and is in fact much easier to script as people can only miss an object by rolling a 1(unless there AB is in the negatives). You'd just have to increment some local on the object that tells it how much of that ammo's ID to create at it's location when the object is destroyed.





Retour en haut







