[Logo]
 
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Artifact Polling. (Moved here from PM conversation)  XML
Forum Index -> Druids RPG Development
Author Message
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

Szlat wrote:
Players have got a lot better about switching the triple on, blasting monsters, switching the triple off. So I have a feeling that most of the time ActiveArtifactInv may give the incorrect answer. 


Dru wrote:
Yeah, we'll have to keep an eye on it. I haven't noticed it as a problem, but I'd like to know if you have. 


As a note to those of you reading this. The code is on a timer. It checks every 5 seconds whether or not you have an artifact on, so at best, you will get somewhere between 0 and 5 seconds of leech and drip when you activate an artifact.

Szlat wrote:
No, I hadn't noticed. I didn't realise it was on a timer, and just assumed it checked fully at the time. So, I don't think anyone has cottoned on yet. However, it might partially explain the confusion about if drip and leech work with an artifact running. Some people are testing and it says yes, others testing and it says no. 


Dru wrote:
The 5 seconds seemed a safe interval for the server to do. The problem with more rapid scanning is that our server is already under high load with 20 players. When I initally put this in, this was the only way to prevent serious lag due to cpu usage. 


Dru wrote:
I've thought about creating a new base class, the trouble is that without changing the RPG core itself, or wholesale copies of code from the RPG core, it just cant be done. unrealscript has no concept of multiple inheritance. The only other option to do this would to create a containment-delegation, similar to what the RPGWeapon does to hand the calls off to the child weapon, but I dont know all the methods that would have to be delegated, and I'm not sure it's worth the extra replication overhead. 


Szlat wrote:
What I was thinking of was a class called DruidRPGArtifact which inherits RPGArtifact. The only difference being when you activate a DruidRPGArtifact it increased a count in the ActiveArtifactInv object, and when the artifact stops, it decrements the count. Then, all the artifacts inherit from DruidRPGArtifact rather than RPGArtifact.
You have your own versions of most of the artifacts anyway, so it wouldn't take long to do the last few.
It means that when you need to check for an active artifact, you just need to check the count in the ActiveArtifactInv, and you no longer need to do the full inventory scan.

Unless there is something in the RPGcore I haven't thought of?

As an extra, is it possible in UnrealScript to give the Energy Leech class a reference to the ActiveArtifactInv object for the player? Then you wouldn't have to do an inventory search to find the ActiveArtifactInv each time you damaged a monster. 

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

Szlat wrote:
Unless there is something in the RPGcore I haven't thought of? 


Sort of... Even most of the classes I have with changes extend Mysterial's base classes. I don't want to step on his toes by making an entirely different RPG using all his sources, so I extend his wherever possible so my stuff cant be used without his stuff.

If there was just multiple inheritance, or even interfaces like we have in java.

We *might* be able to implement something using this: http://udn.epicgames.com/Two/UnrealScriptDelegates

I need to read up more on delegates to know.

Szlat wrote:
As an extra, is it possible in UnrealScript to give the Energy Leech class a reference to the ActiveArtifactInv object for the player? Then you wouldn't have to do an inventory search to find the ActiveArtifactInv each time you damaged a monster. 


The Ability classes are all well defined static methods. No one instantiates them, and I think they're all marked as Abstract.

Which is to say there's no way to assign the ActiveArtifactInv to it for a specific player.

It might be possible to create a static Hashtable like lookup in this class from player id to ActiveArtifactInv, but I don't know if it's worth the effort...

That, and I'm told there's no Hashtable like object in UnrealScript.

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

TheDruidXpawX wrote:
Even most of the classes I have with changes extend Mysterial's base classes. I don't want to step on his toes by making an entirely different RPG using all his sources, so I extend his wherever possible so my stuff cant be used without his stuff. 

Agreed. It is all possible only due to the vision and work Mysterial put in. But if we produce classes which inherit from Mysterial's classes, then it will still need his code to work. And it will always require the RPGRules.

TheDruidXpawX wrote:
Which is to say there's no way to assign the ActiveArtifactInv to it for a specific player 

Pity. It would be nice to be able to cut down the number of inventory scans.
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

Suggestion: get rid of ActiveArtifactInv. Just check if the currently selected item is active or not using Instigator.SelectedItem. Then prevent an artifact from being switched if it is still active.

(don't know how possible it is to stop the switch - might be easier on each artifact to check on each tick if it is the selected one - if not deactivate)
 
Forum Index -> Druids RPG Development
Go to: