Staredit Network > Forums > Modding Assistance > Topic: Random modding questions
Random modding questions
Mar 18 2013, 12:47 am
By: Pr0nogo  

Mar 18 2013, 12:47 am Pr0nogo Post #1



List will be updated as new questions come to mind.

Can an attack be unlocked by an upgrade? In other words, can a unit without an attack (i.e. Overlord) be granted one after an upgrade has been purchased? (possible w/ plugins)
Can I make a unit (i.e. an Overlord) periodically spawn other units (i.e. Zerglings)? Can this be triggered to happen only after an upgrade has been purchased?
Can I make a unit's attack projectiles (i.e. Lurker spines) slow the units they hit (using Ensnare, perhaps)? Can this be triggered to happen only after an upgrade has been purchased?
Can I make a unit that self-destructs (i.e. Scourge) EMP units around it before self-destructing (using iscripts, perhaps)? (possible w/ iscripts)
What do I have to do in order to iscript in a critical chance, or a chance of a second attack being used (using iscripts)? (possible w/ iscripts)

More to come.

Post has been edited 2 time(s), last time on Mar 18 2013, 4:36 pm by Pr0nogo.




Mar 18 2013, 1:06 am Biophysicist Post #2



1) Yes, with a plugin. The easiest way is to create two versions of the unit, one with and one without the weapon, and swap the first type to the second type if its controller has the upgrade.
2) Do you have Dark Swarm/Disruption Web, or Spawn Broodlings, unused? If so, yes, with a minor plugin. Otherwise, I'll need to think about it.
3) The easiest way would be to give the unit two weapons, with the second weapon being a copy of Lurker Spines but with its effect set to Ensnare, and add attackwith 2 after attackwith 1 in iscript. If the unit already has two weapons, or if it's supposed to only attack land units, then it becomes trickier, and once again will take a plugin. (This is assuming that the unit in question uses a Lurker-style attack, as you implied. If its projectile just hits a single target, you can just useweapon Ensnare in the attack animation, or use a trivial plugin.)
4) This one's easy. In the attack animation, just useweapon EMP.
5) There's an opcode called randcondjmp, which jumps to a block if an x out of 256 chance is met.

While I'm here... I know I've kind of been a jerk to you in the past, and I'm sorry for that. I'm more than willing to help you out and stuff, and honestly I can't even remember why I was upset with you in the first place.



None.

Mar 18 2013, 2:04 am Pr0nogo Post #3



1) So it would be like triggering a normal unit to be removed and replaced by a hero unit, except with plugins instead of triggers?
2) Spawn Broodlings is Spawn Butterlings. Dark Swarm is Disinfectant. I can probably cannibalise Disruption Web if necessary, but let me know if there's a way around it.
3) I directly want the Lurker to slow ground units that get caught in its line of fire. Since Ensnare is no longer being used as a spell, can I make the weapon only affect specific kinds of units (e.g. flag it so it can't affect robotic units and flag all air units as robotic)?
4) Add that line of code before attackwith 1? I'll cross that one off the list.
5) Can you provide an example of that? Also, say I want a Zealot to randomly discharge AoE shock damage. I presume I'd be adding a second attack to the Zealot. If I flag it to attack ground units only, will it fire in place of the first ground attack (the standard Psi Blades)?

A new question: can I make Spawn Broodlings target terrain? (not possible)

Post has been edited 1 time(s), last time on Mar 18 2013, 4:35 pm by Pr0nogo.




Mar 18 2013, 2:56 am Biophysicist Post #4



1) Sort of. The difference is that the unit will not be a new unit, so its stats like HP and stuff will carry over, hotkeys won't be lost, etc.
2) There really isn't. Creating units directly is not a thing I have any idea how to do. Poke Heinermann if you really need it to not use Dweb.
3) I just realized how to do this! You'd set the Lurker's attack to apply Ensnare, and use a plugin to remove Ensnare from fliers and damage any non-flier affected by Ensnare.
4) Right. The line you want is "useweapon X", where X is the weapon ID for EMP, which I can't look up right now.
5) See codebox for an example. For the Zealot thing, well... No. I'm not sure exactly what you're asking, but I can tell that it doesn't make sense. Now, given that Zealots are melee, what you could do instead is just useweapon the AoE damage, and use imgol or sprol for a special graphic if desired.
6) No, sadly.

Code
FooGndAttkRpt:
   wait 1
   randcondjmp 64 DoubleStrike
   attackwith 1
   gotorepeatattk
   goto FooGndAttkToIdle

DoubleStrike:
   attackwith 1
   attackwith 1
   turncwise 2
   gotorepeatattk
   goto FooGndAttkToIdle


Can't check that code, but I think it's right.



None.

Mar 18 2013, 5:01 am O)FaRTy1billion[MM] Post #5

👻 👾 👽 💪

For the weapon one couldn't you set the button requirement to a tech being researched instead of has weapon?



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Mar 18 2013, 11:14 am Biophysicist Post #6



It could still auto-attack though, and be able to be ordered to attack via right-click.



None.

Mar 18 2013, 3:23 pm Sand Wraith Post #7

she/her

1) If you are short on unit IDs, you can use a plugin to directly order an attacking unit to stop if it does not fulfil your conditions.

2) Consider using Scanner Sweep. Although, I am unsure of how you will manage it without glitches. As I imagine it now, you would need to order your Overlord to Sweep at its own position, which would override its current order and/or order queue.

You COULD do this with triggers, probably. If you are making a mapmod, I am sure it is possible. (Although I'm not sure how you would move the locations to the correct positions. Memory access to that would make it fairly easy though.)

3) Just beware that the Ensnare effect would have to entirely be devoted to this purpose. You could probably use Corrosive Spores for this too (maybe).

4) Just a note that useweapon x plays the graphic associated with the weapon (ex. if you were to use Dragoon's bullet, it would make the blue sparkly effect on the attacked unit). Note also useweapon does not use a projectile. Its behaviour is a little more specific depending on weapon behaviours.

5) Making the Zealot randomly make an explosion as he attacks is largely identical to making it hit twice in one blow. Just use a useweapon x call instead (or a attackwith 2 if you want).

NOTE: Depending on how you implement it, if you decide to use attackwith 1 twice or useweapon x twice or an N number of times in a row, EACH CALL/WEAPON STRIKE IS AFFECTED BY ARMOUR AND UNIT SIZE. So if you use Gauss Rifle 10 times in a row, it will deal 60 damage to a 0 armour opponent, but against a 1 armour opponent it will deal 10 less damage.

Avoiding this damage reduction would be as simple as using a useweapon x where the weapon used has the correct, full value (then the critical strike damage is reduced only once). This may be a desirable balance consideration, though (for example, making a Sniper unit that only deals considerable damage against Small units, or similar).

Hope this helps.




Mar 18 2013, 3:49 pm Biophysicist Post #8



Quote
(Although I'm not sure how you would move the locations to the correct positions. Memory access to that would make it fairly easy though.)
GPTP can do that easily. Both it and FaRTy's EUDDB have a location table mapped out.



None.

Mar 18 2013, 4:34 pm Pr0nogo Post #9



Quote from Biophysicist
1) Sort of. The difference is that the unit will not be a new unit, so its stats like HP and stuff will carry over, hotkeys won't be lost, etc.
2) There really isn't. Creating units directly is not a thing I have any idea how to do. Poke Heinermann if you really need it to not use Dweb.
3) I just realized how to do this! You'd set the Lurker's attack to apply Ensnare, and use a plugin to remove Ensnare from fliers and damage any non-flier affected by Ensnare.
4) Right. The line you want is "useweapon X", where X is the weapon ID for EMP, which I can't look up right now.
5) See codebox for an example. For the Zealot thing, well... No. I'm not sure exactly what you're asking, but I can tell that it doesn't make sense. Now, given that Zealots are melee, what you could do instead is just useweapon the AoE damage, and use imgol or sprol for a special graphic if desired.
6) No, sadly.

1) That's the desired effect.
2) Alright.
3) So in DatEdit, give it the Ensnare effect? I don't do coding, unfortunately.
4) I'll look it up myself. It's the number next to the weapon entry in DatEdit, correct?
5) I was trying to ask if I could make the Zealot randomly crit to do twenty or so damage in a medium-sized AoE. In my mod, Zealots aren't ranged units, but the AoE should come out of them to help defend against melee attackers. Would this require a second attack entry, or should I rely on useweapon instead?
6) Okay.

Quote from Sand Wraith
1) If you are short on unit IDs, you can use a plugin to directly order an attacking unit to stop if it does not fulfil your conditions.
2) Consider using Scanner Sweep. Although, I am unsure of how you will manage it without glitches. As I imagine it now, you would need to order your Overlord to Sweep at its own position, which would override its current order and/or order queue.
You COULD do this with triggers, probably. If you are making a mapmod, I am sure it is possible. (Although I'm not sure how you would move the locations to the correct positions. Memory access to that would make it fairly easy though.)
3) Just beware that the Ensnare effect would have to entirely be devoted to this purpose. You could probably use Corrosive Spores for this too (maybe).
4) Just a note that useweapon x plays the graphic associated with the weapon (ex. if you were to use Dragoon's bullet, it would make the blue sparkly effect on the attacked unit). Note also useweapon does not use a projectile. Its behaviour is a little more specific depending on weapon behaviours.
5) Making the Zealot randomly make an explosion as he attacks is largely identical to making it hit twice in one blow. Just use a useweapon x call instead (or a attackwith 2 if you want).

1) I have zero knowledge of how to make plugins, so *I* can't, but that isn't really what I want to do with the attack upgrade because I know there's no [easy?] way to send an error message.
2) I'm making a (balanced) melee-based total conversion. Maybe I'll make a campaign to go along with it, but that's not my focus right now.
3) I wouldn't want to use Ensnare in any other way for some other race, so that's fine. I don't really believe in the design philosophy of making redundant abilities or hard counters.
4) That's actually good for my purposes. Wouldn't want EMP missiles flying out of buttery Scourges, now would I?
5) So create a weapon for the iscript to call with useweapon? Makes sense.

Quote from Sand Wraith
NOTE: Depending on how you implement it, if you decide to use attackwith 1 twice or useweapon x twice or an N number of times in a row, EACH CALL/WEAPON STRIKE IS AFFECTED BY ARMOUR AND UNIT SIZE. So if you use Gauss Rifle 10 times in a row, it will deal 60 damage to a 0 armour opponent, but against a 1 armour opponent it will deal 10 less damage.

Avoiding this damage reduction would be as simple as using a useweapon x where the weapon used has the correct, full value (then the critical strike damage is reduced only once). This may be a desirable balance consideration, though (for example, making a Sniper unit that only deals considerable damage against Small units, or similar).

The damage reduction actually sounds like something I'd want to keep, and I'm glad that that's the way the system works - otherwise my seventh question would be asking how to make it reduced every time, by different armour values. Hoo boy.

If I wanted to make a bunch of projectiles fan out in a circle (for the Zealot's critical), how would I go about doing that?
Can I make projectiles be the sources of damage, so that the longer a unit stands in a projectile's radius, the more damage it takes?




Mar 18 2013, 5:16 pm Biophysicist Post #10



Heh, poke me if you need plugins. I've added you on Skype.

Quote
5) I was trying to ask if I could make the Zealot randomly crit to do twenty or so damage in a medium-sized AoE. In my mod, Zealots aren't ranged units, but the AoE should come out of them to help defend against melee attackers. Would this require a second attack entry, or should I rely on useweapon instead?
If I wanted to make a bunch of projectiles fan out in a circle (for the Zealot's critical), how would I go about doing that?
How large should the AoE be? If it's fairly small, I'd advise using useweapon and imgol/sprol. But if it's larger than ~32 pixels, you'll need another method, which I'll describe below. Note, though, that the method I'm about to describe requires adding a second weapon to the Zealot, which will make it able to target air units! To get around this, I'd remove the ground weapon and fire it by useweapon instead, and put this second weapon as the ground weapon. You'll have to disguise this weapon as Psi Blades for the UI, though.

Anyway, making projectiles fly out in a circle is pretty easy. The unit needs a weapon like the Lurker's spines, which is set to "Go To Max Range" or whatever. Do something like the following for the unit's attack animation:

Code
FooGndAttkRpt:
   wait 1
   attackwith 1
   turncwise 4
   attackwith 1
   turncwise 4
   attackwith 1
   turncwise 4
   attackwith 1
   turncwise 4
   attackwith 1
   turncwise 4
   attackwith 1
   turncwise 4
   attackwith 1
   turncwise 4
   attackwith 1
   turncwise 4
   gotorepeatattk
   goto FooGndAttkToIdle


The turncwise command turns the unit clockwise a given amount, with 32 being a full circle. turnccwise does the same thing but counter-clockwise. Weapons with Go To Max Range just fire from the unit in the direction it's facing until they reach, well, maximum range. And because there are no waits in the turn/attack section, it'll happen instantly, and no one will see the unit turning because it happens within a single frame.

Quote
Can I make projectiles be the sources of damage, so that the longer a unit stands in a projectile's radius, the more damage it takes?
Sure. Just set it up like the Lurker's weapon, but make it call domissiledmg every frame (and maybe slow down the projectile)?



None.

Mar 18 2013, 5:21 pm Pr0nogo Post #11



Thanks for the code. The AoE should be something like the dimensions of an Archon (the unit, not its attack), and the projectiles should dish out the rest of the damage in a line. Judging by the amount of attackwith entries, I'm gonna have to reduce the damage to an acceptable amount.

domissiledmg should be called within the projectile's iscript and not the unit's, yes?

Would it be possible to replace Leg Enhancements with an upgrade that allowed the projectiles to deal more damage?

/e I don't use Skype, because it consumes massive amounts of CPU for no reason. I still have you on MSN, unless you removed me instead of just blocking me.




Mar 18 2013, 5:29 pm Biophysicist Post #12



Quote
Thanks for the code. The AoE should be something like the dimensions of an Archon (the unit, not its attack), and the projectiles should dish out the rest of the damage in a line. Judging by the amount of attackwith entries, I'm gonna have to reduce the damage to an acceptable amount.
You can adjust the number of attackwith entries, heh. That being said, if it's just Archon-sized, I'd probably useweapon it instead; you get finer control over damage and stuff that way.

Quote
domissiledmg should be called within the projectile's iscript and not the unit's, yes?
Right. I'm not sure what'll happen if you domissiledmg inside something that's not a missile, honestly, but it'll probably spawn an egg sprite or crash.

Quote
Would it be possible to replace Leg Enhancements with an upgrade that allowed the projectiles to deal more damage?
If you do it by useweapon, you could also useweapon a secondary weapon that does no damage but uses Leg Enhancements as its damage upgrade. If you do it by projectiles, you could swap the unit's ID to one with a more powerful weapon when Leg Enhancements is researched, via plugin.

EDIT: I haven't used MSN in forever, heh, but I still have it. You should be unblocked, if I did it right.



None.

Mar 18 2013, 5:35 pm Pr0nogo Post #13



Quote from Biophysicist
You can adjust the number of attackwith entries, heh. That being said, if it's just Archon-sized, I'd probably useweapon it instead; you get finer control over damage and stuff that way.
It should still spawn the projectiles. Unless...

Quote from Biophysicist
If you do it by useweapon, you could also useweapon a secondary weapon that does no damage but uses Leg Enhancements as its damage upgrade. If you do it by projectiles, you could swap the unit's ID to one with a more powerful weapon when Leg Enhancements is researched, via plugin.
In that case, I'll have one weapon do the damage and the other weapon spawn the projectiles (which do damage on their own).

Quote from Biophysicist
Right. I'm not sure what'll happen if you domissiledmg inside something that's not a missile, honestly, but it'll probably spawn an egg sprite or crash.
Makes sense. That would actually fit the lulzy style of the TC, but things should still be functional, so I'll just go with what works.

My next question is about the bounce weapon type. How the hell do you make it work without the damages being uncontrollable? I tried giving a Dragoon the weapon type and it only damaged the last enemy that the projectile bounced. Is that something in the projectile's iscript that has to be changed? I remember editing it with the help of IskatuMesk, but then it just crashed.

I sent you an IM but you're listed as offline.




Mar 18 2013, 5:38 pm Biophysicist Post #14



Re: AoE: Well, the problem with doing the additional damage via useweapon is that that'll only apply to the unit's primary target.

Re: Bounce: Yes, it's iscript. Look at the Glave Wurm's iscript and it'll be obvious. Basically though, there's some weird animation (Burrow, iirc), that's played upon bouncing, which you need to add.



None.

Mar 18 2013, 5:48 pm Pr0nogo Post #15



AoE: I can't make the weapon deal splash damage that emanates from the unit itself (and not its target)?
Bounce: Interns...




Mar 18 2013, 6:13 pm Biophysicist Post #16



1) I'm pretty gorram sure there's a way. I'll need to look it up.
2) I'd think that, at some point, Glave Wurm played a different graphic on its final bounce, or something, so they needed the first two bounces to use a different animation, and chose Burrow because a weapon would never need a Burrow animation otherwise.



None.

Mar 18 2013, 6:56 pm Pr0nogo Post #17



Let me know what you find for AoE.
The Glave Wurm was originally Acid Splash, so yeah, that makes sense.

Is it possible to make a projectile bounce back and forth between only two targets until one of them is dead?




Mar 18 2013, 7:34 pm Sand Wraith Post #18

she/her

Useweapon x uses the behaviour of the weapon specified (the x is from the weapons.dat).

If the x weapon has splash damage, it will still deal splash damage. For example, tell a scourge to use a Nuke as it dies: this should work properly (but without the graphic - that would need a "sprol" command).

EDIT:

Quote
Is it possible to make a projectile bounce back and forth between only two targets until one of them is dead?

It MAY BE POSSIBLE with a plugin. IIRC, the weapon struct has a field for the number of bounces - one can continuously set the bounce to a number lower than the max. Thus, the weapon may bounce continuously. Possibly. I have not tested this out at all.

Post has been edited 1 time(s), last time on Mar 18 2013, 7:41 pm by Sand Wraith.




Mar 18 2013, 7:36 pm Pr0nogo Post #19



But will the splash damage emanate from the attacking unit or the target of the weapon? Or will it depend on how I code it in iscript?




Mar 18 2013, 7:43 pm Sand Wraith Post #20

she/her

Please be aware I edited my previous post.

Splash should emanate depending on the behaviour of the weapon as specified in weapons.dat. You can set the weapon to "Appear on Attacker" or "Appear on Target Unit" (or something along those lines).




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:22 am]
RIVE -- How're the uploads tho? Banger content or wut
[03:42 am]
Ultraviolet -- and yet you've been here almost twice as many days as me
[01:24 am]
Ultraviolet -- my 20th anniversary was in July O.o
[11:11 pm]
Zycorax -- Been here for nearly 20 years :wob:
[04:49 pm]
Ultraviolet -- SEN membership is like the supreme court, we're here for life baby
[2024-11-10. : 4:13 am]
O)FaRTy1billion[MM] -- ya
[2024-11-10. : 2:46 am]
slayer766 -- wtf farty you around still hahaah
[2024-11-09. : 4:24 pm]
Oh_Man -- da real donwano
da real donwano shouted: Who can crack into an old protected map & remove the trigger for insta-defeat for playing solo?
me
[2024-11-09. : 12:48 am]
RIVE -- j
[2024-11-08. : 10:41 pm]
lil-Inferno -- p
Please log in to shout.


Members Online: bin226587