IJass pre-release, ways to improve?

Executor

I see you
Reaction score
57
Hi,

I'm atm working on a project called "IJass" (Ingame Jass), which will allow the user to use jass code via chat ingame designed for debugging purposes (or even a JASS - battle game? :D).

I post the readme and the current code.

JASS:
// Hello and welcome to my IJass readme.
// 
// First of all: 
//
// "IJass? Whats that?"
//
// - "IJass" stands for "Ingame Jass". This means you use jass code (indirectly) while ingame.
//   ~ indirectly ~ because of every single native you may use exists one wrapped function
//   in my library. That's why my library is so big.   
//
// "Okee and how do I do this "IJass" - thing?"
//
// Well, have a look at the interface, it should explain itself. But you should have in mind,
// that YOU have to know the natives you want to use, aswell as unit ids and so on.
// 
// In the case you configured IJass in a way, that COMMAND_PREFIX is not "" you ALWAYS
// have to type the char you filled this variable with in front of your IJass commands. Other
// inputs will be recognized as plain text and not as a command.

// the (ingame) interface:

// *************************** INTERFACE ****************************************************

//  Jass: "call CreateUnit(Player(0),'hfoo',0.,0.,0.)"
// IJass: "CreateUnit(Player(0),'hfoo',0.,0.,0.)

// there are also some enhancements out there:

// you can skip parameterinput, this means the rest of the parameters will be filled with the 
// specific null value of the type:
// "CreateUnit(Player(0),'hfoo',0.,0.,0.)" equals "CreateUnit(Player(0),'hfoo')"
// this only works, if you skip the parameters till the end of the function.

// you may assign variables:
//  Jass: "set somePlayerVar = Player(0)" or "set someUnitVar = CreateUnit(..)"
// IJass: "someVar = Player(0)"           or "someVar = CreateUnit(..)"
// YES, you may assign every type you want, but it's your turn to check whether you use them
// right or not. Assigning one variable-name twice will override the old value

// you may also combine aspects:
//              Jass: "set myPlayer = Player(0)"
//              Jass: "call CreateUnit(myPlayer,'hfoo',0.,0.,0.)"
// becomes
// combined => IJass: "CreateUnit(myPlayer = Player(0), 'hfoo', 0., 0., 0.)"
//
// shorter =>  IJass: "CreateUnit(myPlayer = Player(0), 'hfoo')"

// another example:
// "myUnit = CreateUnit( myPlayer = myCoolPlayer = Player(0), myID = 'hfoo')"
// "KillUnit(myUnit)"

// ************************** END INTERFACE *************************************************


system code to long for the post, so here it is

Atm only CreateUnit, BJDebugMsg, UnitAddAbility, SetUnitState, Player are included.

Which spaces will be deleted?
061209132944_ShowStringErase.jpg



This system is NOT finished yet, I only want to gather some ideas to improve :)
 

Attachments

  • IJass.w3m
    88.2 KB · Views: 179

Hatebreeder

So many apples
Reaction score
381
Hmmmmmz.. o_O

This is cool :'D I can think of fun stuff to do xD

But, one question: when you execute a command, what type does it have to be typecasted to?

like, you type: call KillUnit(thatunit)

What type does "KillUnit(thatunit)" have to be? Since I don't think you can execute strings, no?
 

Executor

I see you
Reaction score
57
"thatunit" => "THATUNIT" (not case sensitive).
"THATUNIT" has a hashtable reference to a "Data"-struct-instance.

JASS:

struct Data
    integer TYPE
    string   value
endstruct


If you stored a unit lately in "THATUNIT" you can simply call "KillUnit(thatunit)" but if you stored a integer in "THATUNIT" you will get an error.
 

Hatebreeder

So many apples
Reaction score
381
Oh i see. So you made everything use one struct?

Hmmm... I thought, that you'd have some chat event going on.
I didn't look in the Map and the Code yet, but I was assuming that you had "call" as an indicator for [ljass] call ExecuteFunc(string) [/ljass] blabla.

But then again, it had to be a function. Which would mean, that you could only call GUI related functions and used the variables that already existed in the game at that time... Like, call KillUnit(SomeSpellStruct_Data.Caster)

EDIT: not too sure if you are able to give the function any parameters....
 

Executor

I see you
Reaction score
57
No, it's a little bit more work :p

The reason, why you may only use these 5 functions atm is, that I have to wrap EVERY function, you will be able to use ingame.
And I wait with the writing-a-little-program-which-converts-every-native-in-such-a-wrapped-native-process, till I know definitly that I won't modify anything anymore :)

@Hatebreeder, I suggest you'll have to test it simply :D
 

Hatebreeder

So many apples
Reaction score
381
No, it's a little bit more work :p

The reason, why you may only use these 5 functions atm is, that I have to wrap EVERY function, you will be able to use ingame.
And I wait with the writing-a-little-program-which-converts-every-native-in-such-a-wrapped-native-process, till I know definitly that I won't modify anything anymore :)

@Hatebreeder, I suggest you'll have to test it simply :D

UnitAddAbility(Unit,Ability) doesn't work :D
same for UnitState....

But CreateUnit(Player,Unit) works
 

Executor

I see you
Reaction score
57
Hm, it does work on my pc.

Try the following:

  • myUnit = CreateUnit(Player(0),'hfoo')
  • SetUnitState(myUnit,UNIT_STATE_LIFE,100.)
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
>And I wait with the writing-a-little-program-which-converts-every-native-in-such-a-wrapped-native-process, till I know definitly that I won't modify anything anymore

Post the format needed and I could write that in a couple of minutes.
 

Executor

I see you
Reaction score
57
Yea, UnitAddAbility works NOW :D somehow forgot to add [ljass]//! runtextmacro AddNative("UnitAddAbility")[/ljass] (updated the map.)

@phyrex1an
Ty for your help, but I already have this program, it's just that I'm not totally sure with the wrap-syntax and therefore don't want to rewrite this program + the total code every day.
 

Nexor

...
Reaction score
74
Hah, try to avoidthings like creating unit to a non-existing player
I tried creating a footman for Player(16) and crit error happened.

Anyway it's a nice thing!

Oh andthe BJDebugMsg does ignore spaces, like: BJDebugMsg(hello I'm so nice!)

And it displays: helloI'msonice!
 

Executor

I see you
Reaction score
57
Hah, try to avoidthings like creating unit to a non-existing player
I tried creating a footman for Player(16) and crit error happened.

Anyway it's a nice thing!

Oh andthe BJDebugMsg does ignore spaces, like: BJDebugMsg(hello I'm so nice!)

And it displays: helloI'msonice!

Hm yea, I delete all spaces of the string, thats easier to analyse. I'll see what I can do.
Hm this Player(16) thingy will be hard to fix, because I would have to declare bounds for several convert-natives.

Wolfie had already do something like that.

Link?
 

saw792

Is known to say things. That is all.
Reaction score
280
I started making something like this with bytecode at one point. That would have allowed every possible combination of commands in much less space, that is until I got bored constructing functions out of hex commands.

This is quite cool... if only this was even slightly useful.
 

Executor

I see you
Reaction score
57
Updated, now not all spaces are erased.

Constructive criticism on the library mechanics or the interface or sth.?
 

Executor

I see you
Reaction score
57
Hm, I'm thinking about some kind of dynamic functions or boolexpr (especially for enum).
Basically this would be an array of string, evaluated on call.
Not usuable? Opinions?
 

aliminator8

New Member
Reaction score
3
being able to create a trigger in game would be pretty awsome....event --> condition --> action kinda thing... now that i think about it, perhaps a built in function that will show all the code in a function/trigger in game and its links to other functions and variable use data too
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top