[Logo]
 
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Need some help making a custom ability (Using Loaded Monsters and Artifact Loaded)  XML
Forum Index -> UnrealScript, Coding, Mapping, and 3rd party Mods
Author Message
Nighthawk2088


[Avatar]

Joined: 11/01/2007 09:03:32
Messages: 4
Offline

Hello everyone, I am looking for some help on coding a custom ability.

What I want to do is this:

Give a player the ability to make specific magic weapons (Sturdy, Vampire etc...) using the Loaded Monsters type skill. What I mean by that is, each new level the player would get another artifact that would allow them to make another type of magic weapon, like how you get another monster to summon when you level the ability in Loaded Monsters.

I have read the Druid's School for modifying and editing topic and also I know how to make the artifacts to make the specific weapons too. I just need help on knowing how I can make it so that each new level of this ability adds one of these artifacts to the player's inventory.

Thank you, and I apologize for the somewhat long post.
Szlat

Wicked Sick!

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

If you look at DruidArtifactLoaded, there are config arrays for adding various artifacts at various levels. DruidsRPG200 has two arrays SlowArtifact and QuickArtifact - later versions get two more arrays ExtraArtifact and TeamArtifact. The contents of these arrays are set in the configuration.
The artifacts get added in function ModifyPawn.

You perhaps need to replace by 10 arrays called Level1Artifact to Level10Artifact - assuming your ability has 10 levels. In each array configure what artifacts you want adding at that level.
Then change the ModifyPawn function with bits of code like
Code:
 	if(AbilityLevel > 1)
 		for(x = 0; x < default.Level1Artifact.length; x++)
 			giveArtifact(other, default.Level1Artifact[x]);
 	if(AbilityLevel > 2)
 		for(x = 0; x < default.Level2Artifact.length; x++)
 			giveArtifact(other, default.Level2Artifact[x]);
 	if(AbilityLevel > 3)
 		for(x = 0; x < default.Level3Artifact.length; x++)
 			giveArtifact(other, default.Level3Artifact[x]);
 etc
 

hope that helps
Nighthawk2088


[Avatar]

Joined: 11/01/2007 09:03:32
Messages: 4
Offline

Thank you very much for a quick response.

Now that would work perfectly.

Edit: This does seem a bit long to have for 1 artifact per level. Is there no way of condensing this code somehow? If you have a way I could condense this I'd appreciate the feedback.

Code:
	if(AbilityLevel > 1)
  		for(x = 0; x < default.Level1Artifact.length; x++)
  			giveArtifact(other, default.Level1Artifact[x]);
  	if(AbilityLevel > 2)
  		for(x = 0; x < default.Level2Artifact.length; x++)
  			giveArtifact(other, default.Level2Artifact[x]);
  	if(AbilityLevel > 3)
  		for(x = 0; x < default.Level3Artifact.length; x++)
  			giveArtifact(other, default.Level3Artifact[x]);
 	if(AbilityLevel > 4)
  		for(x = 0; x < default.Level4Artifact.length; x++)
  			giveArtifact(other, default.Level4Artifact[x]);
  	if(AbilityLevel > 5)
  		for(x = 0; x < default.Level5Artifact.length; x++)
  			giveArtifact(other, default.Level5Artifact[x]);
  	if(AbilityLevel > 6)
  		for(x = 0; x < default.Level6Artifact.length; x++)
  			giveArtifact(other, default.Level6Artifact[x]);
 	if(AbilityLevel > 7)
  		for(x = 0; x < default.Level7Artifact.length; x++)
  			giveArtifact(other, default.Level7Artifact[x]);
  	if(AbilityLevel > 8)
  		for(x = 0; x < default.Level8Artifact.length; x++)
  			giveArtifact(other, default.Level8Artifact[x]);
  	if(AbilityLevel > 9)
  		for(x = 0; x < default.Level9Artifact.length; x++)
  			giveArtifact(other, default.Level9Artifact[x]);
 	if(AbilityLevel > 10)
  		for(x = 0; x < default.Level10Artifact.length; x++)
  			giveArtifact(other, default.Level10Artifact[x]);
Szlat

Wicked Sick!

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

Just have one array LevelArtifact that has all of the artifacts in. Then in ModifyPawn have
Code:
 for(x = 0; x < AbilityLevel; x++)
   	giveArtifact(other, default.LevelArtifact[x]);
 
Nighthawk2088


[Avatar]

Joined: 11/01/2007 09:03:32
Messages: 4
Offline

You hit the nail right on the head there! I was thinking of something like that but I couldn't seem to figure it out... I hate when I get a mind block on how to do something.

Thank you for your help, time, and patience.
 
Forum Index -> UnrealScript, Coding, Mapping, and 3rd party Mods
Go to: