Fallout 2 scripts as java source codes

dude_obj said:
It would be a perfect environment for modelling critters and other game objects....

Darn Right! Thats why Java is a nicer OO model language than C++.
(well from a programing perspective anyways)

Alos, Good idea about a smaller VM model instead of the standard J2SE one.

I think now the FSE has 2 elements: a INT to JAVA convertor and extra fallout flavoured meathods, classes.

Other than the potentially LONG wait while the FSE parses thru the native fallout scripts and creates the java/class files.
But once they are converted the scripts will be ?nicer? to edit as Java files.

Also:
Code:
    /**
     * Whenever the critter takes damage of any type, this procedure will be
     * called. Things like setting ENEMY_ and LVAR_Personal_Enemy can be set
     * here.
     * 
     * @return int value
     */
    public int damage_p_proc()
    {
        if (source_obj()==dude_obj()) {
            set_local_var(6, 1);
            set_global_var(7, 1);
        }
        return 0;
    }

Would it be possible to GET RID OF NUMBERED VARIABLES?

such as "set_local_var(6, 1);", it is both annoying and likely a source of errors...

I mean if these Fallout scripts are gonna get Javafied we might as well go all the way... named variables and all.
 
dude_obj said:
Maybe. A lot depends on what unfolds with IanOut and whether sztupy is even open to this kind of tangent with his engine.
The engine is open source so you're free to do with it whatever you want as long as you release your modifications under GPL license. IMO SztupY wouldn't mind if you try to include a java scripting system, but I don't see big advantages over lua.

Lua is quite simple and the only problem is that we would have to write the lua scripts kinda from scratch. But feel free to modify the sources, why creating a whole new engine from scratch, when there is already a quite working one :)
 
Mangler said:
Would it be possible to GET RID OF NUMBERED VARIABLES? such as "set_local_var(6, 1);", it is both annoying and likely a source of errors...

That is what define.h and all of the other header files are for. The way you get rid of numbers is by having a name translation. Most of the FO2 source uses names not numbers, the included defines change them into numbers. So it's already done, if you want a name add it to a header. For example for random item selection I have weapon subtypes:

#define weapon_subtype_random (0)
#define weapon_subtype_punch (1)
#define weapon_subtype_knife (2)
#define weapon_subtype_spear (3)
#define weapon_subtype_club (4)
#define weapon_subtype_sledge (5)
#define weapon_subtype_throw (6)
#define weapon_subtype_explosive (7)
#define weapon_subtype_pistol ( 8 )
#define weapon_subtype_smg (9)
#define weapon_subtype_shotgun (10)
#define weapon_subtype_shotgun_combat (11)
#define weapon_subtype_rifle (12)
#define weapon_subtype_rifle_combat (13)
#define weapon_subtype_rifle_assault (14)
#define weapon_subtype_biggun (15)
#define weapon_subtype_minigun (16)
#define weapon_subtype_energy_pistol (17)
#define weapon_subtype_energy_rifle ( 18 )

And I also have weapon skill groups:

#define weapon_skillgroup_smallguns (19)
#define weapon_skillgroup_bigguns (20)
#define weapon_skillgroup_energy (21)
#define weapon_skillgroup_unarmed (22)
#define weapon_skillgroup_melee (23)
#define weapon_skillgroup_thrown (24)

So in a script to wield a random weapon, the value is actually a number, but you don't use the number in your code, you use the name:

item := pickRandomWeapon(variable weapon_subtype_rifle, 100)

We can't get rid of the numbers, but usually names can be used instead. The precompile step converts all those names to numbers for the compiler.
 
Back
Top