Log in

View Full Version : Scripting language


Newspaz
Jul 21, 2005, 02:20 PM
FQuist came up with this idea a while ago in the future of Jazz forum, and sinve then I've been thinking of making a Python module we could use to connect to Jazz2. I decided just to go ahead with it today, and that's the reason why I'm posting this thread.

So, I'm wondering, what kind of functionality would you like to see in such a language? Or do any of you have other ideas for the module?

n0
Jul 21, 2005, 02:31 PM
My original idea was to have the Area ID events be new events, and then we could have about 256 new events. I have no idea what python is, but would be most interested in learning about it. I have been poking around in JJ2's memory, but am having a hard time detecting Area ID's. I could, at this very moment, make a program that gives Trigger Zones a new function, like: Activate Trigger Zone ID 15, Instant deathbut, seeing how Triggers are already used, and 16 is a small number, I would like to use Area ID's.

If anyone has thoughts on how to detect either the XY for Area ID's, or detect when your charcter has interacted with an Area ID, or any other unused events, for that matter, I will work on my own project. Otherwise, I'd love to have a look at python.

-=Edit=-
Sorry, I'm rambling.
Area ID's would be good to utilise because:

A. There are 256 diffrent ID's, meaning 256 diffrent events.
B. Area ID's are not used in game, thus we are not negating any other effects.
C. Area ID's are easily inserted into levels, they are just a normal event and do not require anything but the JJAID program running in background.
D. If a client is not running JJAID, then there could be a text string saying JJAID needs to be running, and the client doesn't even need to exit Jazz to start running JJAID.
E. JJAID is a cool program name, probably cooler than python.

Newspaz
Jul 21, 2005, 02:43 PM
Python is the name of the scripting language I use. The JJ2 module will sort of create a simple way of accessing parts of JJ2, so everyone can be creative and write his own JJ2 scripts.

A very simple example of things that you should be able to do in the end is.. skipping a level when for example player 3 hits a specified position in a level.


import jj2

while 1:
if jj2.position.player3 == "45,33":
jj2.control.next_level


** Please note this code is pure fiction.

EvilMike
Jul 21, 2005, 04:36 PM
Python is my personal favourite for something like this, and I am glad that's what is being used.

Area ID stuff Unfortunately, these events are actually used in jj2. The rocket turtle boss follows a path of these events through a level. Other than that they have no use, and I doubt there is a good way of using them like you described. Also, I believe that parameter they have is completely ineffective and does nothing.

I support newspaz's idea of just specifying a specific position in the level instead. It's a little nit more time consuming, but a lot easier.

As for functionality, I think the scripting language should be able to do the following things.

-Set triggers (preferably globaly and locally, though I have no idea how to globally set triggers)
-Change level, gametype, max score, current score...
-Change players health. There should be a way to set it to infinite, so you can make players invincible.
-Maybe some sort of magical way to spawn players, although I dont think there is any way to do this.
-Things in the script should be triggerable by things like players dying, points being scored, triggers being activated, whatever else you can think of.
-Make it so things in the script can be triggered by/affect anyone, specific players, or depending on which team a player is on. If there's no way to detect which team a player is on, just go by whether they are an even/odd player number.
-If the script says to do something like "increment score by 1 when player is at position 50,50" make sure the score doesn't skyrocket if the player stands on that one tile. The player should have to go off of the tile and then on it again for the action to repeat.


This is really basic and probably somewhat obvious, but it would be a good starting point. It would make it easier to do custom gametypes, at least.

Oh, and I assume a lot of scripts would be level specific. So there should probably be some way to make sure the script only runs in the right level, either by checking the filename, level name, or both.

Monolith
Jul 22, 2005, 06:41 PM
Sorry, I don't have any specific ideas, but I am interested in how you're going about with this project.

Newspaz
Jul 23, 2005, 06:57 PM
I'd like to make a request to everyone reading this.
If you have a list of memory addresses Jazz2 uses, please send me a personal message. It would take me ages to find everything you guys already know all by myself.

Newspaz
Jul 26, 2005, 06:08 AM
I sort of am having an ethical problem here.

I mean, what would happen if I'd make it work on client side of games as well?
I think people would soon start to make lots of annoying stuff like warpers and such.

So, my problem is. Should I:
1. Make it really versatile and try to make it work on both server and client side. Or.
2. Should I only make scripts work when the server is running them?

ShadeJackrabbit
Jul 26, 2005, 03:11 PM
I agree with URJazz

Link
Jul 26, 2005, 04:56 PM
Despite the extraordinary usefulness of a scripting language, it would be like distributing a very powerful cheating program. Even if few people know how to use it, there are bound to be scripts passed around that do possible negative things.

I suggest a positive verification system. If the program is running on the server, it can set the terms of how client scripts are used (i.e. no scripts allowed, all scripts allowed, specific scripts allowed). If the program is not running on the server, the client program will not be able to run scripts at all. This configuration ensures that people can't take advantage of others who don't know about the program, but can still use scripts with the consent of the host.

EvilMike
Jul 26, 2005, 06:15 PM
I agree with Link. Doing that would limit the abusability of the program without severely limiting actual useful functionality. The server should control what script the clients are running.

It would be useful if you found a way to make an option for clients to automatically download the script the server is running , like UR suggested. This would make it a lot more powerful.

Monolith
Jul 26, 2005, 09:56 PM
I agree with Link says as well. I haven't thought about it all too much, but that seems to be the right way to go.

Newspaz
Jul 27, 2005, 11:40 AM
Okay,

But don't expect too much the first versions.
I'll try to come up with at least this for a first version:

- A version that can at least run scripts serverside.
- At least three somewhat useful example scripts
- Documentation.

mirrow
Jul 28, 2005, 09:18 AM
make a global style for positions like square brackets [posx,posy]
[32,43] it sjust easier imo and less misunderstanding

but nm :P

Newspaz
Aug 1, 2005, 02:48 PM
import jj2


gameLoop = jj2.GameLoop()

if gameLoop.get_gameType() == "ctf":
print "Changing to battle..."
gameLoop.set_gameType("battle")
else:
print "Changing to capture the flag..."
gameLoop.set_gameType("ctf")

Just posting a sample of one of the things I have so far... to try and inspire some of you.
(It also automatically checks if the game is running, if you are the server, and if it's the right version of JJ2)

EvilMike
Aug 1, 2005, 08:39 PM
I'm definitely looking forward to when this is released.

Even if the first version is server side only, it will be a lot of fun to see what new things can be done with it.

Erik
Aug 4, 2005, 01:40 AM
http://www.lua.org Go there. Use it. That's an order!

laffer
Aug 11, 2005, 08:46 AM
Has anyone thought about making a mod to increase the difficulty in Jazz 2?
This could be done by simply setting the max hearts to 2, or similar stuff.
Would making such a mod be hard? I have no programming skills myself, so I don't know.
It would be very awesome if someone could make that.

laffer
Aug 11, 2005, 10:37 AM
Sorry to double post, but I just have to say this game NEEDS a difficulty patch.
The game is so great in all other ways, but it's a major letdown that a blind 2-year old could finish this game on hard without loosing health :p

Btw, have Epic said anything about releasing the source code to this game?

LittleFreak
Aug 11, 2005, 10:39 AM
They won't release the source code. And believe me, it's better if they don't.

By the way, if you want to play a difficult episode, check out Tomb Rabbit (http://www.jazz2online.com/J2Ov2/downloads/info.php?levelID=272).

laffer
Aug 11, 2005, 10:51 AM
Why is it better if they don't?
And would it be possible to reduce the amount of hearts you have without access to the source code?

LittleFreak
Aug 11, 2005, 10:54 AM
I think it's better because if all coders out there changed the sourcecode to improve JJ2, sooner or later it wouldn't be JJ2 anymore.

It's maybe possible to change your health factor with a scripting language, but I don't know. Without, it's not possible.

(of course, you could just jump into a few lizards if you feel you've got too many hearts, but that would be annoying to do. ;) )

Grytolle
Aug 24, 2005, 11:57 PM
I think auto-downloading scripts could be sort of a security threat...

EvilMike
Aug 25, 2005, 02:56 AM
I think auto-downloading scripts could be sort of a security threat...
I doubt it. The scripting language would only be able to affect jj2 and it would have limitations. The worst that a malicious script could do is probably something like crash jj2 or cause you to automatically say stupid things. Nothing really bad.