| 03-13-2005, 04:52 PM | #1 |
Alright, here's the deal: In the game I'm making, you are able to convert your army of soldiers to undead equivilants (basically I'm just making it so u can change units into the undead models) I know thats really not enough info but... the problem is with the trigger... if you guys can spot some error in my trigger I'd be much obliged... Trigger: Events: P1 Types a message: Rise Warriors of the Dead Condition: None Action: (I'm going to leave out the few incosequential ones I know have nothing to do with it...) Unit Group - Pick all units in _Location_ matching (Unit-type of picked unit is equal to _Unit_) and do Replace (picked unit) with a _Unit_ using the old units relative hit/mana points. The other triggers are special effects... if that has anything to do with it... Btw, do you think it might have something to do with not being able to do a _pick all units_ thing twice in the same trigger? Or having a special effect placed on a unit while its being replaced? Any help will be much appreciated. |
| 03-13-2005, 05:04 PM | #2 |
Why do people use 'Unit - Replace Unit'? Everytime somebody uses, they have a problem. Why? It doesn't work, that's why. What you need to do, is remove all the units in _Location_, and the create the new model units. Doing so as this: Code:
Trigger
Events
<Player> Types a message <message> as an <exact match/substring>
Condition
Action
Pick all units in <Region> matching (Unit-type of picked unit is equal to <Unit>) and do multiple actions
Set UnitNum = Number of Picked Unit
Remove Picked Unit
Create UnitNumb <Unit> in <Region> for <Player> facing default buiding degreesAnd that would work. Now the seeting UnitNum may be different, but I'm pretty sure you can do that like that. UnitNum btw is either a Real or Integer type variable(your choice, both will work, just convert one to another). If there isn't a way to Set UnitNum to the number of units within a region(although I'm 99% sure) just make another trigger, and add any entering unit to a region to a unit group(one unit group for each player, just do a check) and then Pick every unit in that unit group to make the change. Also make a integer/real variable to detect how many units are in the player group. |
| 03-13-2005, 05:12 PM | #3 |
Ahhh, I see. Okay, I've never really tried using Replace - Unit before, and I never heard of any1 having problems with it, but apparently they do. Okay, I'll do it your way, it seems like it will be less buggy if I do it right, too... time to get back to work lol :god_help_us: |
| 03-13-2005, 05:28 PM | #4 |
Well, it's mostly people like you who have never used it before that use it, because they see it as a solution to what they want to do. I mostly just stray away from questions concerning it because I don't feel like continously typing it over and over, but I did this because it was a short explanation. Most people know just to stay away from. And I've never seen a case where somebody has gotten the replace function to work, so as far I know, it doesn't work. |
