| 04-23-2003, 09:00 PM | #1 |
now i need help on another trigger. this is what i what to do: when a player types this message: level 1 creep, i what the 1 to range from 1-10 and make a random creep of the lvl that is typed. and then create that random creep in the triggering places region. i nave no clue about variables so i cant get to far. |
| 04-23-2003, 10:07 PM | #2 |
There is no way to do it with out variables. Well first you are have to create an array of Unit-Groups, call it Creeps for now, and create an integer and call it Level for now (Level will only be used in 1 trigger). Next, at 1 second elapsed time set Creeps[1] to contain all the creeps that are of level 1, set Creeps[2] to all the creeps that are of level 2, and so on. Then create this trigger: Code:
Events:
- Player X types a chat message containing " " as a SubString
Condtions:
- Substring( (EnteredChatString), 1, 6) == "level "
- Substring( (EnteredChatString), 10,15) == " creep"
* The numbers here may be off by 1 or 2.
Actions:
- set Level = ConvertStringToInteger( SubString( (EnteredChatString), 7, 9) )]
- if( Level < 1 OR Level > 10 ) then
- Skip Remaining Actions
- Create 1, UnitTypeOf( RandomUnitFromUnitGroup( Creep[Level], PlayerX, <Region>, Default Building Facing Degrees) |
| 04-23-2003, 10:23 PM | #3 | |
Quote:
i dont get what i need to do. |
| 04-23-2003, 10:43 PM | #4 |
Oh, sorry... and forgot to mention you will have to create an area that has all the creeps types in it, dividing that into 10 regions, each region containing all the creeps of each level, (you can HIDE and PAUSE these creeps if you need to). If you dont have the space on your map for these units there is another way to do it, but harder (requires more variables). Code:
Events:
- Elapsed Time is 1 second
Condtions:
- None -
Actions:
- PickEveryUnitInRegion(CreepRegionLevel1 AndDo AddPickedUnitTo Creep[1])
- PickEveryUnitInRegion(CreepRegionLevel2 AndDo AddPickedUnitTo Creep[2])
- PickEveryUnitInRegion(CreepRegionLevel3 AndDo AddPickedUnitTo Creep[3])
(continue on for levels 4 - 10) |
| 04-23-2003, 10:53 PM | #5 |
woa, i already had 10 places with the creeps in it. lol. and do i need ALL of the creeps or can i have the ones that i what? cause i dont what any flying creeps cause all the heros r meele. speaking of meele vs flying, if a meele hero is able to attack air units, does it have a high chance to miss? cause i played this final fantisy RPG type game, and there was flying units, and my meele hero could attack it but missed almost every time. or it might be targeted as ground that is 2700 or sumthing from the gound |
| 04-23-2003, 11:01 PM | #6 |
No, you dont need ALL the creeps, just the ones you want. And for the flying unit, the melee unit has a 0% chance to miss unless the flying unit has evasion and/or the melee unit has curse on it. |
| 04-23-2003, 11:07 PM | #7 |
ok thx. was that trigger hard to do? |
| 04-27-2003, 01:28 AM | #8 |
on this trigger: Events: - Player X types a chat message containing " " as a SubString Condtions: - Substring( (EnteredChatString), 1, 6) == "level " - Substring( (EnteredChatString), 10,15) == " creep" * The numbers here may be off by 1 or 2. Actions: - set Level = ConvertStringToInteger( SubString( (EnteredChatString), 7, 9) )] - if( Level < 1 OR Level > 10 ) then - Skip Remaining Actions - Create 1, UnitTypeOf( RandomUnitFromUnitGroup( Creep[Level], PlayerX, <Region>, Default Building Facing Degrees) how do i get the event 'Player X types a chat message containing " " as a substring? how do i get player X? or do i have to make on of these triggers for every player? |
