HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Ability Syntax Command

01-15-2007, 02:32 AM#1
Mapz_Maker
this thread discusses a concept previously mentioned on wc3jass.com that is rather 'unique' this concept is that you can build 'mini-programs' that are embedded into abilities by being located in the special effects section, which seems to have been built for this purpose do to the ease of it's use. working with that concept i created an engine titled 'Ability Syntax Command' (due to it's nature) that can fast and efficiently execute 'scripts' to make fast easy and good spell making that could be i guess you would say 'multiinstanceable' or whatever the point is is that you could have simple scripts that are fast and easy like
Code:
ifnot`casterowner`'targetowner'
sfx`target`'Abilities\Spells\Other\HowlOfTerror\HowlCaster.mdl'
sfx`caster`'Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl'
switchpos
select`caster`'targetowner'
select`target`'casterowner'
switchowner
wait`10`
sfx`target`'Abilities\Spells\Other\HowlOfTerror\HowlCaster.mdl'
sfx`caster`'Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl'
switchpos
select`caster`'targetowner'
select`target`'casterowner'
switchowner
else
text`Don't try to target your own units! Target the enemy!!`
endif
that code although it may look complicated is rather simple. it is a fast way to program an ability that if the target is not owned by the caster it switches the owners and positions of the target and caster units, creates special effects at the locations, then it selects the caster unit for the target and the target for the caster since they own them now, it waits 10 seconds then repeats, resulting in a seamless 'morphing' of one unit into another temporarily. else it displays a text message. download the sample map i created that utilizes this concept and has the engine i built for it, which has 5 variable calls and 19 commands as well as a comment 'command' (//) allowing you to comment on the scripts, the scripts partially utilize 'self-debugging' aspects that will notify you if you made an error that prevents interpretation on most of the commands by displaying. As an added bonus i created an if-then system which allows you to do things such as
Code:
if`data1`'data2'
kill`caster`
else
kill`target`
endif
or as a contradiction
Code:
ifnot`data1`'data2'
kill`caster`
else
kill`target
endif
if refers to if this is == to that then do this
ifnot refers to if ( not( this is == to that)) then do this
else and endif are self-explanatory

you might be able to have an if-then inside and if-then, it just has not been tested very fully, please check-out my sample engine. (update 1)
Attached Files
File type: w3xAbility Syntax Command.w3x (25.2 KB)
01-15-2007, 03:23 AM#2
Vexorian
But now there are much better alternatives, even there's a way to have this without making the interpreter thus forgeting the string leaks) I mean, as easy as typing the JASS code there and then using a preprocessor to move it to the map.

Edit: Forgot to say, good work..
01-15-2007, 10:55 PM#3
Mapz_Maker
Quote:
But now there are much better alternatives, even there's a way to have this without making the interpreter thus forgeting the string leaks) I mean, as easy as typing the JASS code there and then using a preprocessor to move it to the map.
umm, have you ever tried to do
call Variable
it says you should define a function, if this is possible could you please tell me how, that would be cool in it's self

Edit: thanks for the compliment :)
01-16-2007, 01:08 AM#4
Vexorian
what are you talking about?
01-16-2007, 03:33 PM#5
shadow1500
Putting an interpeter for parsing it in the map would suck terribly.

Making a translator-preprocessor to convert the ability code to jass code is a lot better. Or maybe just use jass code with preset variables and functions and save yourself the time to translate from two languages...
01-16-2007, 11:30 PM#6
Mapz_Maker
@shadow umm, what are you talking about shadow? have you dled the map?
@vex upload the code that would 'as easy as typing the JASS code there and then using a preprocessor to move it to the map.'
@all has anyone dled this and understand it's concept?
01-17-2007, 12:38 AM#7
PipeDream
How does this extend what Mike did? The syntax you presented is less powerful-not even turing complete. I think DSLs are a great idea and separation of code and data is a fine ideal but using the ability fields like Mike did is a nightmarishly bad idea. With all the recent tools like JASSHelper and Mike's pack you can separate your code out into a file.

Like Shadow said a compiler from some other language to JASS or a JASS based VM could be a fruitful exercise. There are several issues that are unlikely to be resolved in the current generation of preprocessors whose resolution could improve the convenience of spell making. For example, working with timers is a pain in the ass. A language that ran timers from a wait statement (including in loops) would, at the least, assist in prototyping.
Avoiding set to null - perhaps through game cache - and dynamic typing would similarly assist in prototyping and could be made fast enough for one shot effect spells.
01-17-2007, 01:23 AM#8
Mapz_Maker
1) What are DSLs?
2) This is meant to be a simple easy to use syntax that will get the job done, the thing 'mike' created would require your absoloute devotion to the concept such as you memorize the whole syntax, this on the otherhand uses sensical commands, that are one lined so that it is

wait`5`
not
wait
5

which would to take longer to script in (using 'mike's way).

3) this does not extend what mike did, i was inspired by 'mike's idea, that is the reason i made this, out of inspiration for the want for a simpler engine that would be still functional, and if you look at mike's engine the example (from what i read in the wc3jass forums) merely add and removes Multishot at the time of the attack! this actually does stuff that you would want to be able to do.

4) Im not sure this qualifies as a preprocessor this is an in-game processor.

5) Why is Vex the only one who says that i actually did good in my attempt to create an interesting 'engine-type' thing

6) I feel like im being made to ramble... (lol)

EDIT: forgot to mention you may use any sfx art field that you choose to use (convenience), and you should check out the map.
01-17-2007, 01:27 AM#9
Vexorian
This seems harder for me to memorize. I think that there might be better ways to do this stuff. If you ask me, I think that something like A new generation templates system that uses JassHelper's ability to read data from slk would work, I also think that I could make JassHelper get the struct and required template data from object editor fields... hmm
01-17-2007, 01:32 AM#10
Mapz_Maker
Elaborate?

(my engine is more jass like then mike's that is where i've laid the claim for memorization, and it does not matter what order the info is in, it is the marks that tell it what chunk of info it is so it could be polar'distance'`angle`;unit; or polar`angle`;unit;'distance' or polar WHEEE IM SKIPPING SPACE!! `angle` ANOTHER SKIP!!! 'distance' AND ANOTHER!!! ;unit; the point is that the first thing be the command then the info be within the proper markings, if that helps you)
01-17-2007, 01:45 AM#11
shadow1500
Quote:
@shadow umm, what are you talking about shadow? have you dled the map?
No but the information you provided in the thread is enough for me to make conclusions.

Quote:
4) Im not sure this qualifies as a preprocessor this is an in-game processor.
Exactly, it is completely uneccecary to interpret code in-game when you can just handle it when the map is saved. (With preprocessors)
PitzerMike made the map and concept before preprocessors were possible so he had to do what he did.
01-17-2007, 09:16 PM#12
PitzerMike
Oh noes, what did 'mike' do to be put in quotes?

I congratulate you on making this.
I'm sure it was a good exercise and fun to code.
Of course just like the interpreter engine it's not useful any more, since we now have preprocessors.

For example WeWarlocks's commands

//! BeginAbility rawcode
//! BeginEffect rawcode
//! StopAbility rawcode
//! FinishAbility rawcode

//! ObjectOrderEvent order_integer_id
//! PointOrderEvent order_integer_id
//! InstantOrderEvent order_integer_id

can do just what your engine does, just that it's more efficient, more powerful and we can stick with jass syntax.
01-18-2007, 01:12 AM#13
Vexorian
That's not really Jass syntax
01-18-2007, 05:08 PM#14
PitzerMike
You implement the actions with jass syntax.
What I pasted is just the 1 line that adds the event to your function.

Either way comments are part of the jass syntax.
01-18-2007, 08:27 PM#15
Mapz_Maker
Ok, so maybe preprocessors could function better but this was fun to code and it works, it from what i can tell does not cause lag, and it is simple. Thus there is no reason to fret about using a syntax to syntax processor. This is also not coded in the trigger editor which is the reason it has a new syntax format. But i still dont see why most jassers fret about using a new syntax if that syntax's functions are clean (not leaking) because

A. No Lag (normal cases, some wacko idea may cause lag)
B. Can Be Easier to Code With
C. Syntax Engine is more customizable
D. It Works!!

Maybe people should deal with leaks as they go along, not killing themselves by minimizing their capabilities in the hope of preventing the possibilty for a leak entirely (A Leak can be learning experience, and can result in even better jass codes, without using 3rd party stuff [.exe] Maybe we can all learn by not using that, since it removes the need to think as much, learning to find errors in scripts made by yourself and others. Rather than just using programs to automatically find them.)