• 0

    posted a message on Weird bug with spelltrigger, would like confirmation :S

    Yeah XD That was the problem -_- I created a new map and took some time with making the testing unit and the spell so I understand actors a better now :D

    So what happened, just to clarify, is that I used the Blink spell as the "parent spell" but I also made the effect based on that one and that makes the caster teleport to the unit first, before the trigger also makes him teleport...

    Posted in: Galaxy Scripting
  • 0

    posted a message on Weird bug with spelltrigger, would like confirmation :S

    Yeah XD

    Well, that helped the error message, but now I still have the same old bug with them both being teleported :S But I'll just have to try untill it works -_-

    Posted in: Galaxy Scripting
  • 0

    posted a message on Weird bug with spelltrigger, would like confirmation :S

    If anyone would like to try out the weird bug, here's the map...

    But now I also get an in-game error with red text :S

    Says this:

    'PointWithOffsetPolar' [value: 0] Trigger error in 'BurningStep_Main': Could not get 'point' from parameter in UnitSetPosition [value: 65535]

    Weird error if you ask me :S

    Here's the method it's pointing to:

    bool BurningStep_Main ( bool conds, bool acts ) {
        unit spellTarget = null;
        point targetPoint = null;
        fixed targX = 0.;
        fixed targY = 0.;
        //unit spellCaster = null;
        
        point castPoint = null;
        fixed castX = 0;
        fixed castY = 0;
        fixed targetFacing = 0.;
        
        region spellRange = null;
        unitgroup spellDmgd = null;
        
        //spellCaster = EventUnit();
        burnCaster = EventUnit();
        
        if (conds) {
            if ( !( UnitIsAlive( burnCaster ) ) ) { return false; }
        }
        
        spellTarget = EventUnitTargetUnit();
        //targetPoint = UnitGetPosition( spellTarget );
        targetFacing = UnitGetFacing( spellTarget );
        
        targX = PointGetX( targetPoint );
        targY = PointGetY( targetPoint );
        
        //targetPoint = PointWithOffsetPolar( targetPoint, 0.8, targetFacing  + 180 );
        //targetPoint = Point( targX + .45 * 180/PI * Cos( ( UnitGetFacing( spellTarget ) + 180 ) * ( PI/180 ) ), targY + .45 * 180/PI * Sin( ( UnitGetFacing( spellTarget ) + 180 ) * ( PI/180 ) ) );
        //targetPoint = Point( targX + .45 * UnitGetFacing( spellTarget ) + 180, targY + .45 * UnitGetFacing( spellTarget ) + 180 );
        targetPoint = PointWithOffsetPolar( targetPoint, 0.8, targetFacing );
        
        castPoint = UnitGetPosition( burnCaster );
        //castX = PointGetY( castPoint );
        //castY = PointGetX( castPoint );
    
        if ( DEBUG_MODE ) {
            Print( "Target: " + UnitGetType( spellTarget ) );
            Print( "Cast X: " + FixedToString( PointGetX( castPoint ), 5 ) );
            Print( "Cast Y: " + FixedToString( PointGetY( castPoint ), 5 ) );
            Print( "Target X: " + FixedToString( PointGetX( targetPoint ), 5 ) );
            Print( "Target Y: " + FixedToString( PointGetY( targetPoint ), 5 ) );
        }
        
        
        spellRange = RegionCircle( castPoint, SPELL_RANGE );
        spellDmgd = UnitGroup( null, c_playerAny, spellRange, UnitFilterStr( "Ground,Air,Alive;Self,Ally" ), 0 );
        spellRange = RegionCircle( targetPoint, SPELL_RANGE );
        
        UnitGroupAddUnitGroup( spellDmgd, UnitGroup( null, c_playerAny, spellRange, UnitFilterStr( "Ground,Air,Alive;Self,Ally" ), 0 ) );
        //UnitGroupLoop( spellDmgd );
        
        UnitSetPosition( burnCaster , targetPoint, false );
        UnitSetFacing( burnCaster, targetFacing, 1 );
        
        return true;
    }
    
    Posted in: Galaxy Scripting
  • 0

    posted a message on Weird bug with spelltrigger, would like confirmation :S

    Ok, so I'm not entirely sure I'm using the "PointWithOffsetPolar" correctly, and that's why i'm trying to do those calculations myself XD But since I'm used to WC3 and converting to radians and such I can't seem to figure out how to do it wich just degrees :S

    I've tried these three: targetPoint = PointWithOffsetPolar( targetPoint, 0.8, targetFacing + 180 ); targetPoint = Point( targX + .45 * 180/PI * Cos( ( UnitGetFacing( spellTarget ) + 180 ) * ( PI/180 ) ), targY + .45 * 180/PI * Sin( ( UnitGetFacing( spellTarget ) + 180 ) * ( PI/180 ) ) ); targetPoint = Point( targX + .45 * UnitGetFacing( spellTarget ) + 180, targY + .45 * UnitGetFacing( spellTarget ) + 180 );

    But none work...

    The one which work best is the top one, but that one gave the result in the last post -_-

    And the data editor seems like a lost cause for me XD It's impossible to understand all the elements you need to create stuff with it, for me at least :P

    If anyone have a great tutorial for it that might work, but I don't feel like trying to understand it by myself when I feel more comfortable using triggers ;)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Weird bug with spelltrigger, would like confirmation :S

    Well yeah, I was planning to make the knockback using a timer and such, but I should just use a loop then? With a wait in it?

    And yeah, I changed the Caster to burnCaster XD Weird that static doesn't work as you would expect :S So thank you so much! Now I just have to figure out why my new spell moves to the target's "behind", but also moves the target double the range forward. Meaning that when I target the unit, he moves some range forward, and I move to him in that new position.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Weird bug with spelltrigger, would like confirmation :S

    Hi!

    I created a thread before because I was having trouble coding in galaxy and then importing the script, but I've now converted into only using Custom Script triggers directly in the editor. So I created a new thread even if this is about the same code, it's a new problem.

    So I created some code for a spell I'm doing which shouldn't be too difficult but there's some weird bug with it XD It's a blink spell which will move the caster behind the target and then there should happen some more stuff but I haven't gotten to it yet and it's already bugging. So the bug I've encountered is that for some weird reason whenever I target a unit with my spell, the "target" unit actually becomes the caster :S BUT, this only happens with one unit. I used to have the same spell with two of the same units in the test map before, and the spell only worked for one of them. They are both identical units, but for some reason one of them only targeted itself and not the actual target of the spell.

    I would very much appreciate if someone could just test the spell and see if this happens when they test it.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    I'm using PI to make a kind of Shadow Step ability, where you appear behind your target and strike them ;)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Yeah, I noticed thos right after posting XD So I now have working triggers !!!!!! :D Thanks a nbunch, guys ;) Now I'll just have to befriend myself with the Data Editor so I can make some cool stuff :P

    EDIT: Btw, is there a function or something for getting the "exact" value of PI ? (As in 3.14.........)

    Like in WC3, they had a constant called bj_PI which gave you like 3 decimals of Pi (or maybe like 5, I dunno :P)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    But the thing that I don't understand is, how did you get the "Main" function in your trigger to run? Since there's no trigger to make that trigger run, the other trigger shouldn't be created either :S

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Hello again! :D

    Just recieved the hard copy of SC2, and loving it :D Although as you said, the custom maps aren't nearly as developed as WC3 XD ( And I also can't find any Gem TD on EU servers :( )

    Anyways, I STILL can't get this freaking map to work... -_- I'm now considering doing this in Custom Script triggers in the trigger editor instead, but then I'm not sure how to do stuff on Map Init :S

    Some help?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Ok, well I'm always up for improvements when it comes to Gem TD :D

    I've only played for like 3 days now, but I think I'm at the level of a Hard bot, in version 1.0 then ofc... Would that be good enough to have some fun at least on public games? Like I don't need to win but I won't be completely crushed XD

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    I mean I know I can't expect it to be up to the WC3 standard, since WC3 has been around for so long but I guess it's just a matter of time :D I actually play quite a bit of Melee games now, vs AI and it's going quite well :D I have never been "good" at RTS games, not even WC3 in that manner, just the custom maps but since I like the melee maps, I might buy it soon then :D Maybe I'll see you on Battle.net soon then ;)

    @ Kueken531: Gem TD is one of my favourite custom maps on WC3, have you played it alot? Or at all? :P Is it almost like it was back in WC3?

    Btw, have you played against the AI bots? How hard are they compared to some of your 1vs1 matches? Sorry to ask this many questions, but I'd just like to know some stuff :P

    Oh, and also, do you know of any sites to buy a digital copy for a fair price? Since it's a digital copy, I should be able to purchase it from any country, right? :S

    I'm from sweden, and the cheapest way to get SC2 with shipping included is like 45$, which isn't alot but I'll get it on monday XD

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Yeah, and I use some weird way to crack it too, so it barely works :S Gotta go buy it soon XD

    Ok, well then there might not be much you can do then, since it seemed to work for you so I'll just have to wait and buy it :D Is it worth buying you think? If any1 of you played WC3, are there many custom maps like Hero Line Wars, or Arena Wars, och Tower Defence games?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Ok, I need to come clean with something :( I have downloaded SC2 since I currently don't have the money to buy the game, but I had an urge to beging coding with Galaxy, since it's much more similar to modern programming languages than Jass was from WC3. So the version of the Galaxy Editor I have is 1.0.0 (16117), what version is the latest one?

    I ask this because I made the exact same changes to my map as you did before I downloaded your map, and it didn't work, and then I downloaded your map and it didn't work either :(

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Well, the only problem I seem to have is that I can't seem to overwrite the MapScript file in the map :S I import everything, and change First script to MapScript.galaxy and it disappears and then when I check the "reserved file" called MapScript, basically empty :( (It contains an empty InitMap function)

    Posted in: Galaxy Scripting
  • To post a comment, please or register a new account.