| 07-30-2006, 09:38 PM | #1 |
Ok i'm new here and haven't really posted much. Still, figure this site houses many JASS and wc3 editor experts that would be able to help me with my problem. Now as it stands, i'm making a small map that's kind of like an arena style, except you utelize "aircraft" type units whom which, you use to fly around and blast enemies. Now i've already set up a small of rickety design which works roughly how i want it to. Right now it's not multiinstanceable since i'm just setting it up (also because i only use .GUI, but i'm getting help from JASSers to convert once i get my engine setup properly.) but it works ok for 1 player. The difference with this is that I'm developping an engine to make it fully 3d in terms of motion (or close), in which case, i treat unit height as the vertical mesurement. Anyweays, since the system works this way, missiles and units also travel in motions other than on the x and y axis. But i don't know any way of altering the unit's vertical facing with triggering alone. Right now i'm using a system of replacing the player's unit with another that has been tilted by a short angle. This gives the effect that the unit is changing it's vertical facing as well. The problem with this system is that it is choppy, makes it incredible difficult to add other unit types, and makes it impossible to use abilities with the units as the cooldown is always reset each time the unit is replaced by a corresponding one. Now I've thought of a couple of ways to solve this problem but i need help in order to do it properly. 1) If i was to keep this way of using it, i would make the hero a locust unit and track everything via triggering. But in order to detect when "firing a weapon" or somethign like that, i'd need to coding to detect when tyhe player presses a button. perhaps someone can show me what that coding is. 2) I would assume that it is possible to make a model with multiple different "standing" animations and such which would be ok, but i'd need a way to track them properly. Perhaps someone can explain to me how to add animations an slight alterations to models to make the unit tild up or down a certain amount (would require a lot of animations for a smoother effect) and how to organize these animations so that i could set them by index in the editor corresponding an integer variable. 3) I was given this JASS function to try out, but i'm no good with JASS so perhaps someone can explaine it to me. JASS:Code: native SetUnitLookAt takes unit whichUnit, string whichBone, unit lookAtTarget, real offsetX, real offsetY, real offsetZ returns nothing native ResetUnitLookAt takes unit whichUnit returns nothing I asked vile and he gave me this so i could impliment it as custom script: JASS:Custom script: call SetUnitLookAt(unit, "head/origin/etc.", targetunit, x, y, z) -Now my main question is; what does this coding do? and.. -[How do I]/[can I] use this to set the units vertical facing? Or is there some other code/effectiveway to do it? Hopefully someone can answer my questions; i know the second point is more about modeling, but it's mostly the third idea i want to venture. Hopefully someone knows how this can be done. A small demomap of the spell is also attached to this |
| 07-31-2006, 10:40 AM | #2 |
1) You can't detect any button presses straight out, except the arrow keys and escape. You can add abilities to a unit with hotkeys, which can then be detected. 2) Look at the dummy model in the caster system: http://www.wc3campaigns.net/showthread.php?t=80534 . (Model made by infrane I think) 3) Vex said something about UnitLookAt being bugged or something, the model above should solve this problem anyway. |
| 07-31-2006, 08:30 PM | #3 |
K, solved that problem. Thanks for the help. Now i have another dilema. The movemernt system i've made uses arrow keys to move your unit aropund, but when i try it online it's laggy as hell; we're talking 15-20 seconds delay here... and i have no idea why |
| 07-31-2006, 08:48 PM | #4 |
JASS:native ForceUIKey takes string key returns nothing I'm wondering about this native. It doesnt seem to work though. I thought its supposed to make a player press a key. |
| 07-31-2006, 09:22 PM | #5 |
well i was told some natives are buggy; maybe they weren't fully set up when they were made? Dunno. |
| 07-31-2006, 09:55 PM | #6 |
I remember a spell that used that native, I think Daelin made it, and it works there. |
| 08-01-2006, 12:46 AM | #7 |
hmm, well that's not problem any more. Now i have another problem; my map doesn't work online; or at least, it's weird; i use a skill or press an arrow key to change my guy's facing, and it takes him 20 seconds to run it... Perhaps someone can check this new map and tell me why this would happen (again, early stages, and it's really bad and sloppy triggering, but i was going for the effect first. |
| 08-01-2006, 02:27 AM | #8 |
According to Tim, ability begins casting + WSAD has much less latency than keyboard arrows. ForceUIKey works fine. one caveat, numbers refer to the top bar (control groups) not numpad (inventory). Case might also matter. |
| 08-01-2006, 02:41 AM | #9 |
hmmm, but this isn't just minor latency, it's pretty drastic. And besides, the Azeroth grand prix map works fine with keyboard events. |
| 08-01-2006, 09:09 AM | #10 |
Keys = Slow, jerky, and generally unfinished by Blizzard. Use orders if you can. |
| 08-01-2006, 02:42 PM | #11 |
Problems with orders is that I can't customize it the same way you do when pressing keys. The press/release eevnts are needed for my map. Order's won't work well enough. Maybe all actions were screwed up in one of the patches. I'll check the azeroth grand prix map and see if it's screwed up. |
| 08-03-2006, 12:25 AM | #12 |
Only the Head and Chest of model can be used by call SetUnitLookAt. To use other bones you need to do an mdl edit and rename to bones to bone_head or bone_chest. Some custom models may not use the naming for the bones so you may have to edit them anyway. |
