| 09-25-2007, 04:42 PM | #1 |
Can someone pass me the SimError trigger, I lost my .j file with it and I cannot find it anywhere now... |
| 09-25-2007, 04:50 PM | #2 |
| 09-25-2007, 05:03 PM | #3 |
There are so many resources on war3 that I will soon forget where I put my own stuff. Thank you. |
| 09-25-2007, 06:15 PM | #4 |
function TrueSimError takes player p, string msg returns nothing local sound error=CreateSoundFromLabel( "InterfaceError",false,false,false,10,10) if (GetLocalPlayer() == p) then if (msg!="") and (msg!=null) then //call ClearTextMessages() call DisplayTimedTextToPlayer( p, 0.51, 0.96, 2.00, "|cffffcc00\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"+msg+"|r" ) endif call StartSound( error ) endif call KillSoundWhenDone( error) set error=null endfunction Litle more coding by me to place text right at place |
| 09-25-2007, 06:57 PM | #5 |
learn to use jass tags ffs. JASS:function TrueSimError takes player p, string msg returns nothing local sound error=CreateSoundFromLabel( "InterfaceError",false,false,false,10,10) if (GetLocalPlayer() == p) then if (msg!="") and (msg!=null) then //call ClearTextMessages() call DisplayTimedTextToPlayer( p, 0.51, 0.96, 2.00, "|cffffcc00\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"+msg+"|r" ) endif call StartSound( error ) endif call KillSoundWhenDone( error) set error=null endfunction This code is a lol. Learn to use globals also. |
| 09-25-2007, 07:12 PM | #6 |
I don't understand the your code DioD, is it better then Vexorian's or were you joking? Anyways, I like this one: JASS:scope MySimError globals private sound udg_SimError = null endglobals function SimError takes player ForPlayer, string msg returns nothing if udg_SimError==null then set udg_SimError=CreateSoundFromLabel( "InterfaceError",false,false,false,10,10) endif if (GetLocalPlayer() == ForPlayer) then call ClearTextMessages() call DisplayTimedTextToPlayer( ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" ) call StartSound( udg_SimError ) endif endfunction endscope This way you don't have to create the SimError global, which I btw always forget :) EDIT: Though your function has a msg if/then/else which is useful. I asked this somewhere else, but I can't remember where.......How can a string be null? Why does it have a GetLocalPlayer() if/then/else if DisplayTimedTextToPlayer already has that? |
| 09-25-2007, 07:28 PM | #7 |
The location of the message with the '\n' trick depends on screen resolution, so it's not a good solution. |
| 09-25-2007, 08:05 PM | #8 | |
sim errors are for lamers xD no one needs blizz shity stuff =) it's just so btw Quote:
|
| 09-25-2007, 09:28 PM | #9 | |
Quote:
ahahahahahahhahahahahaha, you so totally called yourself a lamer with that last line. |
| 09-26-2007, 07:34 AM | #10 |
Well same happened here, just test code ingame it shows text right at place. |
| 09-26-2007, 09:44 AM | #11 |
So Vex's one is not right then? |
| 09-26-2007, 10:07 AM | #12 | |
Quote:
Of course it is right, it is even more optimized that others. On the other hand if you don't like using udg_ globals you could simply do this: JASS:scope SimError // small modification of Vexorians SimError // only replaced udg_SimError with SimErrorSound so you don't have to use udg_'s globals private sound SimErrorSound = null endglobals function SimError takes player ForPlayer, string msg returns nothing if SimErrorSound==null then set SimErrorSound=CreateSoundFromLabel( "InterfaceError",false,false,false,10,10) endif if (GetLocalPlayer() == ForPlayer) then call ClearTextMessages() call DisplayTimedTextToPlayer( ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" ) call StartSound( SimErrorSound ) endif endfunction endscope |
| 09-26-2007, 04:37 PM | #13 |
Was thinking about the other '\n' trick, for displaying inside the interface... for sim error DioD's is the best method, and should work fine. sim error:scope SimError globals private sound SimErrorSound = null endglobals function SimError takes player ForPlayer, string msg returns nothing if SimErrorSound == null then set SimErrorSound = CreateSoundFromLabel("InterfaceError", false, false, false, 10, 10) endif if (GetLocalPlayer() == ForPlayer) then call ClearTextMessages() call DisplayTimedTextToPlayer(ForPlayer, 0.52, 0.96, 2.00, "|cffffcc00\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"+msg+"|r") call StartSound(SimErrorSound) endif endfunction endscope |
| 09-26-2007, 04:54 PM | #14 |
Credits to Vexorian, DioD, Cohadar and Alexander244. If you use this in your map you must pay each of us 1$ for every player that ever plays your map. |
| 09-26-2007, 05:10 PM | #15 | |
Quote:
|
