| 08-13-2006, 09:13 PM | #1 |
How can i put a size modification by trigger in-game Ex:someone writes size 50 and puts the selected unit size to 50? How can i put a tint modification by trigger in-game Ex:someone writes tint ###/###/###/### RED/GREEN/BLUE/TRANSPARENCY and takes the written color? Sorry guy for disturbing you like this ![]() |
| 08-13-2006, 10:07 PM | #2 |
The size is ok, but the colour is ALOT harder just in 1 string. Because you have to find where the /'s are to get to the next part. Knowing that you CAN do the size part by your self, because somebody showed you chat strings before, just change the action to Animation - Size or something. As for the /'s, im making a lil system which will do that now. Give me 10 mins or so. Btw, this will be in Jass, i doubt their is any other way without using GUI loops... EDIT: Ok, im back, im not sure if this is gonna work, but i think it will. Heres the code: JASS:function ChangeUnitColourRGBAString takes unit whichUnit, string Source returns nothing local integer FirstSlash local integer SecondSlash local integer ThirdSlash local integer i=1 local integer Red local integer Green local integer Blue local integer Alpha local string C = Source loop exitwhen i==StringLength(C) if(SubString(C, i-1, i) == "/") then set FirstSlash = i endif set i = i + 1 endloop set C = SubString(C, FirstSlash+1, StringLength(C)) set i = 1 loop exitwhen i==StringLength(C) if(SubString(C, i-1, i) == "/") then set SecondSlash = i endif set i = i + 1 endloop set C = SubString(C, SecondSlash+1, StringLength(C)) set i = 1 loop exitwhen i==StringLength(C) if(SubString(C, i-1, i) == "/") then set ThirdSlash = i endif set i = i + 1 endloop set Red = S2I(SubString(Source, 0, FirstSlash)) set Green = S2I(SubString(Source, FirstSlash+1, SecondSlash)) set Blue = S2I(SubString(Source, SecondSlash+1, ThirdSlash)) set Alpha = S2I(SubString(Source, ThirdSlash+1, StringLength(Source))) call SetUnitVertexColor(whichUnit, Red, Green, Blue, Alpha) endfunction All you have to do is use that function, but dont put anything like "colour 50/20/12/40" into it. Only put the numbers, dont include the "colour ". If it dosent work, post in the thread and il try to fix it. EDIT2: Their was a syntax error, i'v changed it now, i added a S2I(). EDIT3: Forgot to reset i to 1 after finding a slash. |
| 08-13-2006, 10:50 PM | #3 |
Dude what u want i write in it only like 100/150/200 ??? If yes it doesn't work :( Plz answer the fastest possible :) |
| 08-15-2006, 01:20 AM | #4 |
patience |
| 08-15-2006, 05:24 AM | #6 |
Ok ty wery much |
| 08-15-2006, 10:22 AM | #7 |
The reason i used Jass, is because you dident need to use 3 digits. I dont like maps like that, sorry. Its a easier work around, but can save the map player trouble and confusion. |
