• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Changing Defense Types and Attack Types

Status
Not open for further replies.
Level 7
Joined
Feb 25, 2007
Messages
286
I'm making a RPG with elements, units, and unit types...I need to know how to make a defense type and apply it to a unit so when a unit picks Light, for example, he will have lights armor, then he picks knight, he will get knights armor..But i also need to make elements so that if they dont pick a element there done for completly... Please help me..:pal:
 
Level 7
Joined
Feb 25, 2007
Messages
286
Umm 1st i suck at jass ;\ im trying to learn it sense i pretty much learned alot of gui (not all im still confused with a few but i dont think ill need em) and want to progress... so if you can plz teach it to me...it will be greatly appreaciated
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
To make it easy I would suggest just making all units unarmored, then make the items called the names (light, normal, hero) and just add a great deal of armor bonus according to which it is... would have same effect, else it could maybe be done with a kinda morph ability course you can change the armor type with it. So make the same model, if he picks up light armor replace him with the light armored unit... that can be done in GUI. Or if no GUI just use a morph like bearform or something, so he changes into that when picking up item. (triggered needed to force him to change, and to give him the ability when picking up the item, except if you just want him to click on the item to activate.

Well that was my ideas... think it will be easier to accomplish
 
Level 7
Joined
Feb 25, 2007
Messages
286
That would work (and thank you for your imput) but that wouldn't help with them people that wants to just get on with the game and skip everything...how will I make it so I can do what the Red Baron said but it will also help with them people that are impatient and just want to game..
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
That would work (and thank you for your imput) but that wouldn't help with them people that wants to just get on with the game and skip everything...how will I make it so I can do what the Red Baron said but it will also help with them people that are impatient and just want to game..

Uh? Why should they skip that effect of the attack/defence type change.. isnt it the whole idea behind this tread? :confused:
 
Level 7
Joined
Feb 25, 2007
Messages
286
I mean..like people..they want to play now not read it all make a decision then take more time..so they decide to skip everything (meaning they skip the element choosing and the type of person choosing (in game)) so how do i make it so that it will change your armor, and attack without acctually changing the name but the stats are changed (for example(unit picks fire(units original attack was normal(make normals defense types 25% pierce 5% normal blah blah blah blah)))) or if they dont pick a element then (for example(unit enters region without a item in slot number 1(make units defense 500% damage from all attacks)) How would I do that without changing the acctuall attack..or you could just skip all that I just said and tell me how to jass it to make it normal...Well imma go look on jass shop pro see if it can tell me anything..

EDIT: (EDIT #2)
I think I found it...but some words were in red so i sorta figured it would need some word replacing...Sense i have no knowledge of jass whatsoever I need all you jassers help..Heres the code.. maybe i could do this
JASS:
native          UnitHasItem             takes unit whichUnit, item whichItem returns boolean
constant native ConvertAttackType           takes integer i returns attacktype
(sense for some reason jass doesnt work with color in it..(native was bolded ConvertAttackType was teal or cyan, integer was red and attack tyoe was red please help me)) attack type could be the name of the thing? I dunno if I'm getting false hope and im looking like a idiot, if its by some good luck chance, or what...jass shop pro owns if you look through it...helps even us noobs by taking a complicated jass script in to 1 tiny detail! (oh and for some reason the jass thing is going small (first time ive ever used jass scripting) sorry)
 
Last edited:
Level 35
Joined
Oct 9, 2006
Messages
6,392
I mean..like people..they want to play now not read it all make a decision then take more time..so they decide to skip everything (meaning they skip the element choosing and the type of person choosing (in game)) so how do i make it so that it will change your armor, and attack without acctually changing the name but the stats are changed (for example(unit picks fire(units original attack was normal(make normals defense types 25% pierce 5% normal blah blah blah blah)))) or if they dont pick a element then (for example(unit enters region without a item in slot number 1(make units defense 500% damage from all attacks)) How would I do that without changing the acctuall attack..or you could just skip all that I just said and tell me how to jass it to make it normal

Well if I was to that with the players can skip chssoing of heroes and (just get a random?) then I would a a condition to my GUI replace trigger which replaces the owner of item if unittype of owner of item equals to blabla, then make those conditions for all heroes.
For the morph option it would reguire you to when he picks up the item instantly replace with a item made for the picking hero, so when he use it he will morph to the right (thats aint so good a option, the first is better, and easier)
btw I aint a jasser, but this can be done in GUI, you jsut have to use the right conditions, and (of course the right actions :) )

Hope you got closer to what I meant, if you didnt understand my meaning tell me, then I post a trigger.
 
Level 7
Joined
Feb 25, 2007
Messages
286
Ok, first I like the idea of the morphing...but it wouldn't help because before they pick a element they pick a character..so that would sorta make that whole section useless...and your right..I dont know how to do that..probably one of those few things that always gets me in actions (like for each integer or replace all this..those get me a bit confused) and it probably has all the conditions I dont know (which are alot..I suck at conditions). And theres a way, to change the attack and defense of the unit (to something custom) without jass? Kool... Oh ans btw that code didnt work...Infact it made the code thats alreadly there useless....
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Okay here's a trigger I think will do the trick:
  • Light Armor Trigger
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • ((Triggering unit) is A Hero) Equal to True
  • Actions
    • Set Item = (Item being manipulated)
    • Set Item_Type = (Item-type of Item)
      • If (All Conditions are true) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Item_Type Equal to Light Armor
        • (Unit-type of (Triggering unit)) Equal to Bear
      • Then - Actions
        • Set Hero[1] = (Triggering Unit)
        • Unit - Replace Hero[1] with a Bear (Light) using The old unit's relative life and mana
      • Else - Actions
        • If (All Conditions are true) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Item_Type Equal to Light Armor
        • (Unit-type of (Triggering unit)) Equal to Lion
      • Then - Actions
        • Set Hero[2] = (Triggering Unit)
        • Unit - Replace Hero[2] with a Lion (Light) using The old unit's relative life and mana
Lion and bear is just to hero types I made up, replace them with all the hero types you have, meaning repeat this if-then-else action for all your heroes.
The bear (light) and Lion (light) is the same hero as bear and lion, just with light armor insted.
Well this is how I would do it. Same would work for attack types.
The Light Armor is a item you have to make. (then you can always decide if it should do more then just giving light armor)
 
Last edited:
Level 7
Joined
Feb 25, 2007
Messages
286
Ok thanks that means I need to make about 112 more units....wow.... 1 last thing before I take this on the new unit has the light armor (acctual custom armor) right? well then how would i make that? or is it alreadly incorperated in that...thank you..
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
Light Armour would be a custom item, that you create. The way you actually implement the unit having "light" armour would be to create a custom unit with that armour type in the editor, which replaces the base unit through the trigger.
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Light Armour would be a custom item, that you create. The way you actually implement the unit having "light" armour would be to create a custom unit with that armour type in the editor, which replaces the base unit through the trigger.

Thanks for making it clearer for him, although I thought I made it clear enough... seems I was wrong :cool:

But one thing more about this.. yes you have to create many unit (heroes) to get this to work, but well you just need to copy-paste the hero and just change the armortype (or attack type), so wouldnt take that long.

Also this makes it posiable to strip the hero for all armor and attack if needed :smile:

The attack type change will be the same way, just where you example: pick up a chaos attack (item) insted of the Light Armor (item) and then replace him with hero with that attack, one thing though if the items aint one meaning both attack and armor changing in one item you have to make all armor types for all attack types so he wouldnt lose his armor type, so easier to just make it a combined item: example: Chaos-Light armor (item) replaces your hero with one with light armor and chaos attack. Else you could just use the problem to create some nice combine or soem limits.
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Why not store unit damage value in a variable or in custom value and then detect unit's attack and heal or damage unit more? Or make a custom attack damage system, that would work aswell ! :wink:

Well not realy, as he want it to say it on the unit.... he doesnt just want them to give more dmg...

well ya a hell of unit you need to make, but as said it would still be only 112 unit if you make the items as one that changes both attack and armor, but uh well makes it kinda stupid, so ya 336 units would be needed (if your math is right :smile: )
This could maybe be done with jass but no idea about that, this is the giu way to do it.
btw: how many heroes do you have? There is around 5 armor types and 5 attack types so 336 is quite a bit.
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
16..i have 7 elements (or armors i want to make) and 3 types of combat (or attack) All of them have skills..(for example if you get light for your element you get few healing skills, and you get the light defense)

okay.. then I understand... but about the skills.. those you wouldnt need to make for the hero, those you can just add with a trigger to him when he example gets light amror (item)
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Just noticed a better sulution, where you avoid making all those extra units. You can change both attack type and armor with upgrades, so simply make some upgrades and run them everytime he pics up the item. This should work, only thing would be to find a way to research the upgrade more then one time without making 1000 levels or something
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
I believe he wants armour/attack type to remain constant after they are originally chosen, so you'd really only need just the one level of the upgrade.
 
Status
Not open for further replies.
Top