Custom ItemContainer - WeaponSlot and use whatever is in that slot as my units weapon? Anyone?
As in, linking anything tied to the weapon so instead of a normal marine gun, i swaped it to the voidrays gun by having it in said slot.. with the voidrays beam effects. Not sure how I can set that up, so if anyone can help please do ;)
Ah yea sorry, lol I barely have any clue as to how to describe what im trying to do. What I want is, the way i have my game set up now I created Item classes. So I have Armor:Helmet, Chest, gloves, boots and Weapon:Range as defined locations as equipment spots that i made from the data editor.
So what im trying to do is to create a function that will let my unit use whatever weapon I currently have equiped in Weapon:Slot range which is an item class I made. The map im working on is a third person shoot named pandemicL if u want to try it online. Anyways the way i handle shooting now is with a traceline and a trigger that detects if left click was pushed, then it detects if im hiting a unit or the terrain. In tihs trigger i'm just using a generic environment execute damage effect.
The environment execute damage effect just does a crappy effect on the target and is no way customizable beyond selecting a damage effect. So as I said im trying to come up with a way to create and plug in a function for whatever weapon my unit has equiped, then when I hit leftmouse i use that weapon, displaying all the effects I/behaviors I have tied to it in the data Editor. Hopefully this is more clear..@gizmachu: Go
Still a bit confused about what you want. This is what i got so far, in your map your going to have items that have a class defined as weapon:range.
So you want a function that will give you the damage and any behaviors a weapon has? Don't think that can be done because functions can only return one value, though there are ways around this. One thing that you will need is some custom way to reference the weapon. I suggest just using a global unit type variable. Then depending exactly what you want the function to return the function will vary, For example if you want to get the damage a weapon deals you would be able to use this function http://wiki.sc2mapster.com/galaxy/triggers/catalog-field-value-get/ .
I don't want to go into more detail because im still not 100% sure if this is what your aiming for, and dont wanna waste time making a wall of text for nothing xD.
Yea thats basically what I want, I just dont know how to do the catalog thing. I already have a Unit type Record set up, and an array for each players chosen unit. Just not sure how to go about pulling all of that data and making something out of the catalog function.
The way i thought it could be done is to somehow make a preset or something that can store all the weapon info stuff inside it and then call form that, but I dont know. Another thing im not sure how I would do is, to make the unit use the weapon without issuing an order kinda like how the environment execute function works. I also thought that if you had a weapon, it would automatically just pull all the stuff asociated with the item/weapon as I have a unit version of the weapons so they can be droped/picked up, an item for the bag info, and on the weaponside behaviors and actors.
But yea, I havent the slightest clue to how to actually use catalog, or the database trigger features at all..@gizmachu: Go
EDIT" so yea, im just trying to create a function that will actuallly change all the effects/behaviors etc depending on whatever weapon is equiped in my item class slot, but also so i can get some sort of actual weapon effects working in game.. because with encironment execute damage, there basically is no effects.. You dont see bullets heading twards the target etc.
Well you dont see any of it period with environment.. lol, I tried using Voidray damage and you dont see a damn thing.. which is something id like to fix or make work.. Beams are cool, or watching missiles shoot and fly at my target would be nice. I just dont have the know how... or where to start. Theres just too much stuff and my head is working 360 degrees as it is, but I want to do this right so here i am.. trying to get some help ;p@Alfredthethird: Go
I haven't actually done any work with mouse clicks. I just took a look at the event, and from the looks of it, it will cause lag if you use that event so idk how you would go about doing that, but thats not what your asking here.
k, So besides damage, do u intend for there to be anything else besides damage. I mean like for example a slow effect when an enemy is hit, or maybe some kind of damage overtime after they are hit.
To do this w/o using an issue order and using environment actions, this would have to be half data editor and half triggers. what you would be able to do is make it so that in the editor none of you weapons actually have effects directly linked to them.Create a bunch of Launch missile effects that will have damage effects, and behaviors and the such that you would want those weapons to have, but don't actually give the weapons these effects. Then In your trigger with the event that will "shoot" use http://wiki.sc2mapster.com/galaxy/triggers/create-effect-at-point-from-unit/ . For the point you will have to figure out how to get that on your own, idk anything about tracelines. For the Effect you will be able to use the function that you asked for at the start.
Here is an example of how the function would look. I used place holders like x, and " launch missle effect for weapon x".
Effect of Weapon
Return Type: Game Link - Effect
Weapon = No Unit <Unit>
Grammar Text: Effect of Weapon(Weapon)
Hint Text: (None)
Custom Script Code
General - Switch (Actions) depending on (Unit type of Weapon)
General - If (X)
General - Return Launch missle effect for weapon X
General - If (Y)
General - Return Launch missle effect for weapon Y
General - If (Z)
General - Return Launch missle effect for weapon Z
You will need a global variable for the weapon, not the unit/hero the player is using. Item and weapons are all considered units, even if they are equipped or in an inventory. So you will have to have triggers to set the weapon to the variable every time its changed.
Nevermind the thing about the catalog functions, its not necessary, but it is possible to do this in another way using it. However dont worry about that, this should work just fine.
Edit: Also if you find this confusing or something or have a question go ahead and ask, ill try to respond asap, but imma be going to bed soon.
In my shooting trigger I already have points set up one that detects if a unit is hit by my traceline and the other is if my traceline hits terrain. Now will this function you made show the trails from my unit to target unit/point?
Yea I would like to experiment with weapons that do some cool things like slow speed, or maybe a missle that explodes near a group of enemies and the missle then burst into lghtning that hits an enemy and then moves on to the next enemy, or even a spread shot type of deal.
Why oh why cant there just be a way to type out a a direct link to the item in the data editor.. and have everything be pulled via the weapon or item name.@gizmachu: Go
All the visual effects like explosions or beams or what ever, will have to be done through actors linked to the effects.
Catalog functions deal with getting info straight from the data editor and editing info in the data editor. However the way i did you don;t have to use them, and tbh i think this will slightly easier once its all set up. Its not rly the most seeming direct way but thats what that function i posted basically does, depending on what the weapon is, it will return the effect you want for it. If you want ill post another function that does something simliar though it will use catalog functions and it will have to be done in a slightly different way.
Edit: nvm, the way i was thinking of doing it with catalog functions isn't possible unless you have a custom function (with custom script) to convert a string to a gamelink or have another custom function to manually convert strings to gamelinks but thats making it more complicated then the other way i said. So just try it the way i posted before.
If you dont mind id like to see the catalog way. Dident you say this way I wont be able to acomplish the beam type effect though? I'm not sure if this is the way to do it, but hell it might be.. To me it seems like there has to be a way to see IF i got a weapon equiped, and if i do, a function or something that would pull all the data i need to make the gun work in game.
The way i envisioned it, is basically somehow linking something, where I have names or game links in it like a preset, then those link out and find all the relevant data to make the gun work.
Like as if i was writing on a text file so in that switch function you typed up, i could just link the weapon and it would pull up everything like below. or 2 functions, one for seeing what item is in the weapon slot.. and the 2nd one holding all the info about every weapon i create.
Gun name: Agr 14 gauss rifle
Behaviors = behaviors
Effects = effects
Hey quick question, do you have Ventrillo? might be easier to just talk on there.@gizmachu: Go
yea, but tbh im rly tired, and im about to go to sleep any minute now xD, so tmrw pm or something when you want to discuss this and i wouldnt mind explaining it again. I'll probably be free to dicuss this over vent in like 10-12 hours.
The catalog way might not work because catalogs return string values, and there is no built-in way to convert a string to a gamelink, well not afaik. You would need to convert the string to a gamelink because effects are gamelinks.
No no i understand whats going on, dont really need to reexplain it. I just think maybe, im trying to do something els other then what im describing and being a noob to the editor and all, im not exactly sure how to put everything into details about what im trying to do.
Were on the right track for picking out what weapon is in my units weapon slot without question. But I seen somewhere some guy had a system where he used strings to pull all the data he needed to make the weapons work.. and the way he did it seems to be amazing.. lemme see if i can find it. Now in that he writes the stuff can cary behaviors etc..
You can also goto that renee site and see some weapon she made working correctly with barely any effort when its equiped. Also his inventory is the same as mine almost.. I use less slots but now i linked you a clear picture of what I mean and im trying to get to work.. I just dont understand everything that guy is using to do that. I did not follow his tutorial, i actually just stumbled on it about 7 hours back
ReEdit, well in his map.. his gun effects do not change... its just a stat boost.
The link you sent to me is outdated. XML editing it how people tried to make maps when there was no editor out. As far as i understand how the data editor actually works is, that its just a bunch of text files or something of the sort and they are in XML format. Before the editor was released people had to go and use program to open and edit those text files. Now we have the Galaxy editor, it does it for us and we don't need to do any of that XML editing. Also everything done in that post through XML can be done in the Galaxy editor as well. The carry behavior and carry weapon thing are data fields for items. What they do it when ever that item is carried by a unit they will use that weapon or have that behavior, however they also have a data field for equipbehavior and equipweapon. The difference between those 2 is that carry is when the item is in the units inventory, equip is when the item is in an inventory slot with equip enabled ( idk you if know this but i'll mention this anyways, you enable equip for a specific slot when you create the inventory container).
I can help you more, but i think i would need to know the bigger picture of what your trying to do, because i might be able to help you do it in an easier way or something. For example is the only way you want the hero (ill refer to the unit used by the player as hero) to attack is when you left click your mouse button? Will the hero be able to use the regular attack ability?
also im on atm, but i might be busy, however i will try to get on vent if you are on