1. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  2. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  3. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  4. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  5. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  6. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Need help with a shooting system!

Discussion in 'World Editor Help Zone' started by Simon559, Jan 30, 2011.

  1. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Hi there!

    I'm looking for a system were you can fire with the keyboard,
    For instance with space or Z.

    I need it for a "platform" arrow-key steered game.

    Since I use the arrow-keys I can't use them for the shooting trigger so if anyone know how to do it I would appreciate the help! (and give +rep ofc).

    Thank you in advance,
    Simon559.
     
  2. TheWarchief

    TheWarchief

    Joined:
    Aug 19, 2009
    Messages:
    64
    Resources:
    0
    Resources:
    0
    You must use JASS to make events with other buttons than arrow keys AFAIK
     
  3. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Yeah I figured that I had to do that. But I don't know how xD
     
  4. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,776
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    You don't need JASS :/
    You just need to make a spell with Z as hotkey.

    Space is impossible.
    (Not impossible actually, but just not doable for your game).

    If you really want to detect keys, you'll have to add more natives to the common.j-file, import it and then you can use them in JNGP, if you know JASS of course.
    I still don't think that includes spacebar, but I am not 100% sure.
     
  5. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Well the thing is that the game is based that you dont have the unit targeted since it was possible to move with the mouse then >.< which ruined it :p But if anyone can help me solve that it would be no problems I think :)
     
  6. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,776
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    You don't have to select your ship though...
    You can select a dummy (with triggers) which has those spells (shoot and everything else you need).
    This dummy will be somewhere in the corner of the map and doesn't necessarily need a model.

    So:
    • Selection - Select Peasant 0000 <gen>


    To avoid players clicking on other units, you can add "Locust" to the unit you're playing with.
    This is so you always have that dummy selected.
     
  7. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Oh ty didn't think of that!

    But I don't get the thing with locust? (sorry for being slow)
    Is there anyway to describe it more :p?
     
  8. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,776
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Because you can't click units with locust.
    Otherwise you could click the unit you're controlling and then you wouldn't be able to fire anymore :|
    It's just optional though and there are other solutions for this ^^
     
  9. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    I see I will give it a try :)

    If it doesn't work I could post the map to a post here and if you'd like/want you could add it? (if I'm not able)
     
  10. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Well I managed to make them none-target able with clicking. But you can target them through "drawing a window". And I dunno how to make the unit I'm moving around to attack when I use an ability on the dummy unit.
     
  11. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,776
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    I thought you were going to trigger a shooting system, not make the units just attack ^^
    And then the only thing you need is the location of your unit, when Z is pressed you create a missile (dummy unit) at the location of your unit and move it forward.

    Shouldn't be too hard :D
     
  12. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Hu :p?

    Well How do I make the dummy missile end at a certain range?
     
  13. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,776
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Like in the attached map, probably ^^
    Sorry for the custom scripts, I'm used to working with JASS now and the GUI-forms would've been less efficient and drained too much time (laziness :/).

    This is actually what I thought you wanted (you know, when you press T a missile will fire).
    If you now make that knight in my map the dummy in the corner of your map and change the special effects etc, it might work, or not? :p

    Update:
    • Added AoE-variable.
    • Added max. number of targets.
     

    Attached Files:

    Last edited: Jan 31, 2011
  14. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    will test it :)
     
  15. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Exactly what I wanted! :) Thank you very much :) (thank you for your time and for the trigger :)) I will ofc give credits in map and give you a +rep :)
     
  16. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Btw.. :p should I copy all the triggers and variables?
     
  17. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,776
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Well, if you want to use that system, yes :p
    For that system, all triggers are required (also the "Init" trigger ^^).

    And variables: of course, they're part of the triggers :)
     
  18. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Ok ty :) Btw is there anyway to increase the "area" which the projectile will hit?
     
  19. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,776
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Yes, yes there is... I guess I forgot to make a variable for that, didn't I? :D

    It's in the trigger "Loop".
    You should see this line somewhere (the 5th action in the group):
    • Set TempGroup = (Units within 100.00 of TempLoc2 matching (((Matching unit) belongs to an enemy of (Load 4 of HandleID in SpearTable)) Equal to True))


    Set the "100.00" to the area you want :D
     
  20. Simon559

    Simon559

    Joined:
    Apr 11, 2007
    Messages:
    97
    Resources:
    0
    Resources:
    0
    Oh ty mate! :)