[Logo]
 
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
PreventDeath/ModifyPawn order: solution suggestions?  XML
Forum Index -> Druids RPG Development Go to Page: Previous  1, 2
Author Message
BotFodder

Wicked Sick!
[Avatar]

Joined: 01/13/2006 15:23:41
Messages: 1239
Location: Florida
Offline

Well see the thing is I know the compiler will puke if you try to call a variable (even a bool) that doesn't exist in an object you reference. I'm thinking it might puke when you call a function that doesn't exist in any way in an object (or in this case, ability) you try to.

In other words, if we try to do a simple loop through the abilities (like the current RPGRules does) and call our functions in *all* abilities (without checking to see if they are our extended DruidRPGAbility rather than just RPGAbility), I'm thinking the compiler won't even compile the mod. Much less the logging that may spew during usage if it did compile the mod.

So at what point during this design phase should we say "We shouldn't have to do that" or "That's the wrong road to go down"?

History: When trying to come up with a simple "Don't drop me on death" option for the artifacts, I created a bool in each of the Druid artifacts that I didn't want to drop called bNoDrop (or something like that, and included changes to functions that would stop it from dropping the artifact on death). I then would, during the loop where the artifact is given to the AM, try to "set" the value to "false" (the default was "true").

Thing is, even if I tried to query it's value (if (Artifact.bNoDrop == true)) the compiler would bomb - as not all artifacts would necessarily have the value actually in them. (I thought I might get away with it as I've dealt with languages that, if a value doesn't exist at all, simply returns "false" when queried. UnrealScript is very strict in this case.)

I use the Futurama Prof. Farnsworth Skin: http://www.disastrousconsequences.com/dcforum/posts/list/1595.page
WM: (DC)BotFodder 170
MM: (DC)BotDoctor 141
AM: (DC)BotBooster 147
http://ericdives.com/ - My DC Newbie FAQ: http://tinyurl.com/lz229
Twitter: http://twitter.com/ericdives
[WWW] aim icon [MSN]
Szlat

Wicked Sick!

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

I understand what you are saying. How about some code like
Code:
for (x = 0; x < StatsInv.DataObject.Abilities.length; x++)
 	if (DruidsRPGAbility(StatsInv.DataObject.Abilities[x]) != None)
 		DruidsRPGAbility(StatsInv.DataObject.Abilities[x]).PrePreventDeath(...)
 
 for (x = 0; x < StatsInv.DataObject.Abilities.length; x++)
 	if (DruidsRPGAbility(StatsInv.DataObject.Abilities[x]) != None)
 		DruidsRPGAbility(StatsInv.DataObject.Abilities[x]).ActualPreventDeath(...)
 	else
 		StatsInv.DataObject.Abilities[x].PreventDeath(...)
 
 for (x = 0; x < StatsInv.DataObject.Abilities.length; x++)
 	if (DruidsRPGAbility(StatsInv.DataObject.Abilities[x]) != None)
 		DruidsRPGAbility(StatsInv.DataObject.Abilities[x]).PostPreventDeath(...)
 
 
BotFodder

Wicked Sick!
[Avatar]

Joined: 01/13/2006 15:23:41
Messages: 1239
Location: Florida
Offline

I think "ChildOfClass" might work in this case, I dunno - but yeah you're on target there.

So Dru - is a DruidsRPGAbility class the path you want to go down? I guess the thing to look at is stopping the UT2004RPG RPGRules from running PreventDeath if DruidsRPGRules results in a Prevented Death ... I'll have to take a look at Mysterial's code when I get a chance.

I use the Futurama Prof. Farnsworth Skin: http://www.disastrousconsequences.com/dcforum/posts/list/1595.page
WM: (DC)BotFodder 170
MM: (DC)BotDoctor 141
AM: (DC)BotBooster 147
http://ericdives.com/ - My DC Newbie FAQ: http://tinyurl.com/lz229
Twitter: http://twitter.com/ericdives
[WWW] aim icon [MSN]
TheDruidXpawX

Wicked Sick!
[Avatar]

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

Actually, as long as we call our higher level prevent death method something else, and dont implement it in the child classes, the extension thing should work fine. We dont even need to prevent the call to preventdeath as long as the classes that extend DruidsRPGAbility dont override that method. We'll just have to build a mutator that traps preventdeath and iterates through the players ability list itself, looking for instances of DruidsRPGAbility

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
 
Forum Index -> Druids RPG Development Go to Page: Previous  1, 2
Go to: