• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] RPG Systems Help

Status
Not open for further replies.
Well, I'm still considered a newblett when it comes to Jass and GUI, and I have currently run into a dead end with some of my triggers for one of my RPGs.

First Issue
Testing Commands

For the RPG, I am using different testing commands that will allow me to run scripts, deal damage to targets, etc. Here is the first of the Testing Commands.

To initialize testing mode, Player 1 will have to type in the word "-test" . Afterwords, the game will check the username of Player 1. If it is not "Snowdawn" (My new username), it will deny access to the testing commands.

Is there a condition for checking usernames in GUI, if not, could someone post the code for it?

Secondly, I want the ability to run a script by simply saying "-run triggername" . Can I use If/Then/Else If the second string after run is a trigger that it will run it?

Second Issue
Abilities

Right now, I am working on a spell called Arcane Blast. It is a simple fire-bolt spell that deals 2 times your intelligence in damage at a target. I've tried setting the hero's Intelligence as an Integer named DamageX, then use arithmetic functions to try to deal the damage. Problem is, the editor will not let me choose the DamageX to be inserted into the arithmetic equation. The way I want it to flow out is like so:
  • Events
  • Conditions
  • Actions
  • General - Set DamageX = (Intelligence of (CastingUnit) (Include Businesses)
  • Unit - Cause (Casting Unit) to damage (Targeted Unit) dealing (2.00 x DamageX) damage of attack type Spells and damage type Normal
Ofc, rep is always given for answering my questions.


 
Okay, now for my next issue.

For this RPG, I want to have spellbooks like DeFi4nc3's ORPG contains. For those who haven't played Defiance, the spellbooks works like this:

At level 1, 3, 5. 9. and 13, (I don't know if this is precise) a new spell is added to your spellbook. So, for example, you may start with Firebolt. At level 3, you have the spell Heal added to your book, and you keep your firebolt.

Help would be really appreciated, and, as always, +Rep!
 
Level 3
Joined
Jul 15, 2009
Messages
40
As GhostWolf said, there is a Player Name check in String Conditions-> Player - Player Name.

However, there's not much point in doing this. Couldn't you just remove the test command triggers from the public release?


You can pretty easily set up a system that allows you to do that. Unfortunately, there's no way to make a trigger that runs another trigger with the same name as the substring just entered. You can, however, set up a filter of If statements that allow you to access the triggers. It might go something like this:

  • Events
  • Player - Player 1 (Red) types a chat message containing -run as A substring
  • Conditions
  • (Substring((Entered chat string), 1, 5)) Equal to -run
  • Actions
  • If - Conditions
  • (Substring((Entered chat string), 6, 14)) Equal to trigger01
  • Then - Actions
  • Trigger - Run Trigger1 <gen> (checking conditions)
The substring starting at index 6 will be the name of the trigger you wish to run (though it doesn't necessarily need to be the EXACT name, shorthand would work fine). You will have to have an If statement for every trigger you want to access in that way.


As far as your spell goes, there is a conversion function. It's found by clicking Arithmetic, then scrolling down to Conversion - Convert Integer to Real.

It'll look like this:
  • Unit - Cause (Casting unit) to damage (Targeted unit), dealing (Real(DamageX)) damage of attack type Spells and damage type Normal
 
Level 3
Joined
Jul 15, 2009
Messages
40
There should be an ability called "Spell Book."

You can make a new custom ability from it and add in the abilities you want to it, or you can edit the original. Then attach it to the item (if it is indeed a book), or the hero (if its just a collection of other spells).

Then, you could make some simple triggers that check the hero's level, and if he levels-up, the new ability will be added to the spell book.

The thing is, I don't think you can add abilities to items, so you would have to make multiple spell books with the different abilities and switch them out when the hero levels-up.

Alternatively, you could make the spell book an ability of the hero, that references a dummy unit, to which you can add your custom abilities. That would require a bit more trigger work, though.
 
Level 2
Joined
Jul 13, 2009
Messages
9
1. Get the ability "Spell Book" from Unit > Spell Book
2. Increase its stats levels
3. Fill up the lists

Look the attached screen.

Remember that every next level must contain the skills from the previous so you can
keep the spells.

Other is triggering:

  • TriggName
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Leveling Hero)) Equal to 3
        • Then - Actions
          • -------- ------ Here you set the level of the "Spellbook" ability, so the unit will have more than ability in it ----- --------
          • Unit - Set level of Spellbook for (Leveling Hero) to 2
        • Else - Actions
 

Attachments

  • untitled.JPG
    untitled.JPG
    53.2 KB · Views: 92
Status
Not open for further replies.
Top