Staredit Network > Forums > Modding Assistance > Topic: Weapon Iscripting...
Weapon Iscripting...
Jun 5 2009, 7:51 pm
By: Pandut  

Jun 5 2009, 7:51 pm Pandut Post #1

I'm just a fish

I am currently working on a mod, where one of my units, is equipped with two weapons; A machine gun, and a flamethrower. The first weapon was no problem at all to do, although the flamethrower is really difficult. I want it so that the unit attacks only things that get too close to it, albeit melee units, buildings, or just units that get too close. I believe this was done in Antithesis Rising. I honestly have no idea where to begin, I studied the Iscript used in AR, and only got a little information.

And also, my unit is using the Marine Iscript.



None.

Jun 5 2009, 8:05 pm Biophysicist Post #2



Put the flamethrower as an air weapon but set it as being able to target ground. Then, use the trgtrangecondjmp opcode.

eg.
MarineGndAttkInit:
trgtrangecondjmp 3 FLAMEFUCKINGTHROWER
wait 1
attackwith 1
gotorepeatattk
goto MarineGndAttkToIdle

FLAMEFUCKINGTHROWER:
wait 1
attackwith 2
gotorepeatattk
goto MarineGndAttkToIdle

Post has been edited 1 time(s), last time on Jun 5 2009, 10:37 pm by TassadarZeratul. Reason: fix'd



None.

Jun 5 2009, 9:48 pm FlyingHat Post #3



Quote from name:TassadarZeratul
Put the flamethrower as an air weapon but set it as being able to target ground. Then, use the trgtrangecondjmp opcode.

eg.
MarineGndAttkInit:
trgtrangecondjmp FLAMEFUCKINGTHROWER
wait 1
attackwith 1
gotorepeatattk
goto MarineGndAttkToIdle

FLAMEFUCKINGTHROWER:
wait 1
attackwith 2
gotorepeatattk
goto MarineGndAttkToIdle
You missed a key thing here, TZ.

There are two arguments for the trgtrangecondjmp opcode. Distance in pixels and the name of the block of code.

The distance argument tells the unit at what distance it should jump to the block of code the opcode is pointing to.
The block of code is self-explanatory.

The example script should be changed to:
Collapse Box


Addendum: As an alternative, you can use the useweapon opcode instead of using up your unit's air weapon slot.
Also, use codeboxes and collapse boxes when posting iscript. You should be able to locate the BBCode in the special scrollbox that's at the top-right of the posting opstions.


SEN, say hello to the one of the most newbie-friendly posts in the Modding Assistance forums. With all the colour and shit.

Post has been edited 6 time(s), last time on Jun 5 2009, 10:01 pm by FlyingHat.



None.

Jun 5 2009, 10:18 pm Hercanic Post #4

STF mod creator, Modcrafters.com admin, CampaignCreations.org staff

TZ had the block name (FLAMEFUCKINGTHROWER). All he was missing was the distance.

Distance in IceCC works by pixels. So in FlyingHat's above example, the distance that the flamethrower will be used is 42 pixels. In terms of weapon range, 16 pixels = 1 range. So 42 pixels would be under 3 range units (48 pixels).




Jun 5 2009, 10:39 pm Biophysicist Post #5



Quote
Addendum: As an alternative, you can use the useweapon opcode instead of using up your unit's air weapon slot.
The problem with this is that useweapon spawns the weapon on the target unit. So if you wanted the attack to fly to the target, you'd have to do the air slot trick.

Quote
Also, use codeboxes and collapse boxes when posting iscript. You should be able to locate the BBCode in the special scrollbox that's at the top-right of the posting opstions.
Will do in the future.



None.

Jun 5 2009, 11:28 pm Pandut Post #6

I'm just a fish

EDIT: Oh wait, my mistake. For some reason the 'attackwith 1' command was taken out :lol:

Post has been edited 1 time(s), last time on Jun 5 2009, 11:40 pm by Pandut.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[08:35 pm]
Ultraviolet -- :wob:
[2026-6-21. : 11:38 pm]
Symmetry -- :wob:
[2026-6-21. : 4:56 am]
Ultraviolet -- I suppose we'll likely never know, but my guess would be that they already saw it operating successfully and there was no monetary incentive to finish the original work. And the dev cycle in old school Blizzard was so hectic, it's possible it just got forgotten about after the original game got released. Plus there's an element of existing MPQ files that were packaged with the original discs becoming outdated if they updated it. And it's not like they remade the original MPQs, they just made new ones for BW specifically
[2026-6-21. : 4:26 am]
Oh_Man -- so that makes me think maybe the theory they are unfinished is not true and its a deliberate design decision, coz why not finish them wen ur making brood war?
[2026-6-21. : 4:25 am]
Oh_Man -- the thing is thos buildings are from classic. that means they went ahead and made brood war without ever finishing the 'unfinished' buildings
[2026-6-20. : 6:15 pm]
Ultraviolet -- Yeah he's talked about a lot of that stuff in his casts before. It seems plausible. Especially knowing how Blizzard of yesteryear operated.
[2026-6-20. : 3:47 pm]
NudeRaider -- to clarify: couldn't recall the behavior for every single Protoss building but I was aware the disparity exists.
[2026-6-20. : 3:43 pm]
NudeRaider -- Contained nothing new for me. Didn't know all building's behavior, but very much all unit's. Also Terran balance whine - also nothing new :lol:
[2026-6-19. : 9:57 am]
Oh_Man -- makes me wonder if SEN knows anything about the topic
[2026-6-19. : 9:57 am]
Oh_Man -- artosis dropped pretty interesting vid: https://youtu.be/EqZHB8Blra4
Please log in to shout.


Members Online: Prankenstein