Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Need Help Creatin Suicide BTN Numpad UNITctrl
[SOLVED] Need Help Creatin Suicide BTN Numpad UNITctrl
This topic is locked. You can no longer write replies here.
Aug 28 2012, 1:26 am
By: Radical924  

Aug 28 2012, 1:26 am Radical924 Post #1



Okay I am not that familiar with EUD's but I know they can be used to trigger actions using buttons on the keyboard. I have used EUD's in my map to make a Music On/Off Switch and I was wondering if it is possible to use EUD's to detect when a [building] unit under your control is clicked on and when clicked on if one clicks the "X" button it asks if one wants the unit to be exterminated and if yes then the unit is destroyed if no nothing happens.

I would also like to know if I can use EUD's to control ANY group of unit I control with the numpad keys . I have tried modifying the system on the link below but I wouldn't know where to begin since I am not familiar with EUD's. The reason I would choose the numpad keys are because they don't already control anything in the game and this would allow full unit and game control.

I would use numpad key 8 to move up; 6 to move right; 2 to move down; and 4 to move left.

Anyways if anyone can make me any of these two triggers either the killing your own building with the X button or the any group of unit under your control movement with the numpad keys it would be great. Thank you and happy map making LOL.

Oh and here is the link where I found the EUD mapping Keys (it will tell you all the triggers for the different keys on the keyboard: http://www.staredit.net/topic/6416/



None.

Aug 28 2012, 3:26 am staxx Post #2



Is this for a single player game, or are there multiple players?

If there are multiple players, what you're asking to do will desynch people from each other.
Desynch Trigger Actions



None.

Aug 28 2012, 3:56 am CecilSunkure Post #3



Yes you can detect when a player clicks on something. Try looking up Roy's EUD triggering thingy, it generates EUD conditions for you.

As for using keys to move units, you can only detect when a key is pressed. So, detect when the key is pressed and order whatever units you like (via trigger actions) to move. That's as good as it can get as far I know.



None.

Aug 28 2012, 4:19 am Roy Post #4

An artist's depiction of an Extended Unit Death

Quote from CecilSunkure
Yes you can detect when a player clicks on something. Try looking up Roy's EUD triggering thingy, it generates EUD conditions for you.
Selection detection is indeed covered by EUD Generator. http://www.staredit.net/topic/14408/

As staxx mentioned, key presses are localized addresses, so they will not work in a multiplayer map. You're asking for a lot of things here, but it doesn't sound like you really know what you want.

Quote from Radical924
I was wondering if it is possible to use EUD's to detect when a [building] unit under your control is clicked on and when clicked on if one clicks the "X" button it asks if one wants the unit to be exterminated and if yes then the unit is destroyed if no nothing happens.
This would be easier to do with a Dropship/Factory system where you unload/build a unit to do a certain action. If you want to do selection detection, you need to have a fixed/predictable index id for whatever unit you want to detect. I'm not sure what you mean by "if yes," but I hope you do not mean the player types "yes" in chat, because text detection triggers are an absolute disaster.

Quote from Radical924
I would also like to know if I can use EUD's to control ANY group of unit I control with the numpad keys . I have tried modifying the system on the link below but I wouldn't know where to begin since I am not familiar with EUD's. The reason I would choose the numpad keys are because they don't already control anything in the game and this would allow full unit and game control.
Barring EUD Actions (which require an enabler program to use, such as http://www.staredit.net/topic/10525/), you can't do this. EUD Conditions can only detect things, and you're still limited to regular trigger actions in what you're actually capable of doing. Maybe I misread what you're saying. Are you saying you want to control any unit selection's movement with the numpad keys? Because this will require up to 81,600 triggers for four directions (up, down, left, right), and you'd still have to come up with some grid system to work for each unit to make them move properly. This system is ridiculously complex.

Please, please, please read http://www.staredit.net/topic/14226/. I wrote that tutorial specifically for mapmakers like you who have heard of EUDs before but don't really know too much about them. It's a long read, but it covers all of the basics and helps explain exactly what is possible and what is recommended in the world of EUDs.




Aug 28 2012, 5:16 am Radical924 Post #5



Okay maybe EUD's being used to move any unit is kind of too complex... my bad I thought there was a way to detect when one clicks on a unit and you could just move it around using triggers.....

Also what I meant by the self destruct system is this:

So let's say you accidentally built a building and it has a high HP and you don't have the time it takes to destroy your own building or for other reasons you want to self destruct to prevent points etc....

So now when you go and click on a building of your control all you have to do to destroy it is click the X button on the keyboard. It will then ask if you are sure. Y is for yes and N is for No. I personally would use a switch system which would use death counters..... Anyways what I was wondering was if someone could post the triggers to detect when someone clicks on a building of their control. (It MUST be their control or else someone could walk around massively telling there enemies units to commit suicide lol)

Also please note I only want it to detect when a player clicks the X button if they aren't in the chat box because this could cause people to accidentally kill their buildings.

If you do not know what I mean still by using switches please refer to "my" map here and look at player 1-8's switch triggers... https://rapidshare.com/#!download|246p3|2853715836|Jungle%20World.scx|1588|0|0
-
-
Oh and Roy I quickly looked at your EUD Generator program and noticed I could add the action set game speed to fastest but since EUD actions aren't supported in SCMDraft2 how do I add this trigger in and look at it???
Here is the trigger:

Trigger
Players
  • All Players
  • Conditions
  • Always();
  • Actions
  • Set Deaths("Player 1", "Int:27629", Set to, 6);
  • Comment("Set the game to run on Fastest speed");



  • Oh and can I please have a link to your pro fireball map as the link on this page is broken: http://www.staredit.net/topic/10836/

    Post has been edited 3 time(s), last time on Aug 28 2012, 6:04 am by Radical924.



    None.

    Aug 28 2012, 1:43 pm Roy Post #6

    An artist's depiction of an Extended Unit Death

    Quote from Radical924
    So now when you go and click on a building of your control all you have to do to destroy it is click the X button on the keyboard. It will then ask if you are sure. Y is for yes and N is for No. I personally would use a switch system which would use death counters..... Anyways what I was wondering was if someone could post the triggers to detect when someone clicks on a building of their control. (It MUST be their control or else someone could walk around massively telling there enemies units to commit suicide lol)

    Also please note I only want it to detect when a player clicks the X button if they aren't in the chat box because this could cause people to accidentally kill their buildings.
    Are you confirming that you want your map to be played by only one player? If so, just take the trigger detecting those keys from http://www.staredit.net/topic/6416/ and apply them in unison with selection detection.

    For selection detection, you need to know the unit index, player selecting, and index of the selection (for buildings, this would be the first selection index). My http://www.staredit.net/topic/14408/ program will generate this for you. After this, you just need to know how to find the building in the game; since you'll probably need to preplace the building anyway, this shouldn't be a problem (the reason you need to preplace them is to determine the index ID, unless you want to go through this).

    Quote from Radical924
    Oh and Roy I quickly looked at your EUD Generator program and noticed I could add the action set game speed to fastest but since EUD actions aren't supported in SCMDraft2 how do I add this trigger in and look at it???
    Here is the trigger:

    Trigger
    Players
  • All Players
  • Conditions
  • Always();
  • Actions
  • Set Deaths("Player 1", "Int:27629", Set to, 6);
  • Comment("Set the game to run on Fastest speed");
  • If you notice, the program's text is in red, which is saying SCMDraft's text trigger editor won't be able to parse it. You'll need to enter the EUD in the Classic TrigEdit, typing "ID:27629" for the unit type. Also, if I wasn't clear earlier, anyone who wants to play the game will need to run a patch program like http://www.staredit.net/topic/10525/ for the EUDA to work.

    Quote from Radical924
    Oh and can I please have a link to your pro fireball map as the link on this page is broken: http://www.staredit.net/topic/10836/
    The link in my signature has always worked; I updated the topic's download link as well. Thanks. ^^




    Aug 28 2012, 5:16 pm Radical924 Post #7



    It is okay then for the gamespeed thing cause I don't want people having to run EUDA enabler just to play my game. Also no the selection detection on a building someone controls is supposed to be online. Also the buildings are not supposed to be preplaced they are supposed to be buildings that the user places during the game. I'm sorry if this isn't possible.... Just reply with not possible and I'll not put an X suicide button in "my" map.



    None.

    Aug 28 2012, 11:32 pm Roy Post #8

    An artist's depiction of an Extended Unit Death

    Quote from Radical924
    It is okay then for the gamespeed thing cause I don't want people having to run EUDA enabler just to play my game.
    You need an action enabler for any EUD action, so changing the game speed to fastest without an enabler isn't possible.

    Quote from Radical924
    Also no the selection detection on a building someone controls is supposed to be online. Also the buildings are not supposed to be preplaced they are supposed to be buildings that the user places during the game.
    You can do selection detection in multiplayer. In the scenario you're describing, though, it would be extremely difficult to get the index ids of the buildings (again, it'd require messing with the work documented in http://www.staredit.net/topic/14230/, which is no small task), and additionally difficult to find the correct building with locations (unless you enforce one building per player).

    Quote from Radical924
    Just reply with not possible and I'll not put an X suicide button in "my" map.
    It's not possible for a multiplayer map. In my opinion, it's also not worth the effort in a single-player map.




    Aug 29 2012, 1:22 am rockz Post #9

    ᴄʜᴇᴇsᴇ ɪᴛ!

    To reiterate what has been said already in less words:

    How does player 2 know that player 1 presses the "x" key? He doesn't. Thus, if there is any action in the trigger that player 2 needs to do, then they won't be in the same game anymore. Player 1 will kill the building, but player 2 won't (he never ran the trigger, so the building still exists in his copy of the game).

    Now if you want to press the x key to display some text on the screen, or play some wav file, player 2 doesn't care. He can't see those anyway. The game stays in play.

    It is very possible to know what unit(s) player 1 has selected however. The process of finding out is rather tedious, so I don't recommend it, but I dug up my old concept map here: http://www.staredit.net/topic/6865/ and amazingly the download is still good. In reality, this is slow, cumbersome, and not all that great. You still can't identify exactly where the unit is, or easily detect what type of unit it is, or pretty much anything else. All you know is that this one particular unit is selected.



    "Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

    Aug 29 2012, 3:36 am Azrael Post #10



    If the building that is selected will be unique for the player (as in, each player will only own one of the building in question), then it wouldn't be too hard to make triggers that will allow you to kill that building when it is selected by that player. Otherwise, as Roy said, it would become increasingly complicated with each additional instance of that building the player owns, as you'd need to be able to tell them apart via locations in the map.

    Also, doing it via keystroke is technically possible in multiplayer, if you setup a restriction of some kind which allows for slave triggers (triggers which force the player to act in a certain way in order to convey local information globally). The most important aspect of this type of trigger system is that it must desync someone for not obeying the system, which results in the player either definitely playing by the rules or not playing at all.

    For example, if you wanted to make it so that pressing "X" while the chat box is closed would make the Supply Depot selected by the current player be destroyed, you could setup the following restriction:

    - Having a Supply Depot selected for more than 3 seconds results in it dying.
    - Having a Supply Depot selected for more than 3 seconds without pressing "X" will result in desync.

    Inform players of this beforehand, with any sort of reasoning ("It is an unstable bomb and will kill you if you select it for too long" or something).

    Then, make it so it won't desync the player if they press "X" with the chat box closed. This will result in the Supply Depot dying at the 3 second mark, rather than the player desyncing.

    Alternatively, you could make it so they press "X" before selecting the building, and desync if they select the building without pressing "X" first. This will result in the building dying immediately if they press "X" and then select it.

    However, due to the nature of the specific task you're trying to perform, I don't think slave triggers are the way to go. It would make more sense to remove the keystroke requirement and just go by the length of time the building is selected. I mainly just gave you the additional information so you would know all the possibilities, although there are better ways to do it here (like using a global action to trigger the building death, rather than a keystroke).

    Personally, I would probably go with the option of having a unit or building in the corner of the map that serves this purpose. If it's a unit, I'd detect when it moves, and if it's a building, I'd detect when it produces a certain unit. Then I would give the player a few seconds to select the building they want to destroy, and kill it immediately.

    If you want to go this way, I've developed a fairly simple system which should work regardless of how many buildings you are using, which will allow you to determine both the building's position with relatively few triggers and a single location (speaking of which, I should probably update the Identifying Index IDs thread with said information).

    Let us know the specifics of what you're looking for now that you know some of the restrictions you have to work around.

    Post has been edited 2 time(s), last time on Aug 29 2012, 4:00 am by Azrael.




    Aug 29 2012, 5:51 am Radical924 Post #11



    Hey it's okay I don't need to waste my time with something really complex. When I made the post I thought it would be possible to detect when a player clicks on a building they control without the building being placed beforehand or it being a specific building. Like I said it was an idea that each building could have its own self destruct button as an additional feature in the game. I often play Halo Wars so I thought it would be cool to add this into "my" game ... so again don't bother wasting your or my time I'll just deal with the fact that there can't be a self destruct button... As for the Numpad movement again an added feature I'd like in my map if it was possible but since it isn't I can live with that...Oh and thank you for all your help... I failed to mention I made a pretty good spawning system now which allows for random spawning of force 2 with random races and random difficulties. My only problem I am experiencing with this is that one of the difficulties I set was too easy as all AI's do is collect resources. If you would like to check out the map you can see it here and if you have any bug fixes I should employ just message or post them here. THANK YOU oh feel free to keep a copy of the map as I am going to post a blank terrain version of it on youtube along with a tutorial of how to use it.... this will be in the future as I am thinking of adding in another version of this gametype/map which is like Reinforcements in Halo Wars.

    https://rapidshare.com/files/2853715836/Jungle%20World.scx

    Map Version: August 27th 2012 at 4:41pm PST



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [10:38 pm]
    MTiger156 -- w
    [10:12 pm]
    Christien Chapman -- nub
    [10:12 pm]
    Christien Chapman -- u
    [10:12 pm]
    Christien Chapman -- no
    [07:41 pm]
    lil-Inferno -- Dem0n
    Dem0n shouted: you can put it in Map Showcase if it's complete, or Map Production if you're still working on it
    u
    [03:33 pm]
    Christien Chapman -- Then check for bugs and then it's done
    [03:33 pm]
    Christien Chapman -- I just have to remove some copyrighted sounds that I used for placeholder and do some voice actinf
    [03:33 pm]
    Christien Chapman -- February was when I started it
    [03:33 pm]
    Christien Chapman -- I had nothing to do
    [03:33 pm]
    Christien Chapman -- I've been working on it since coronavirus
    Please log in to shout.


    Members Online: Ultraviolet, Roy, Fesperma, Nekron, KrayZee