Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » General Jazz Jackrabbit Talk

Scripting language

Newspaz Newspaz's Avatar

JCF Member

Joined: Jan 2001

Posts: 2,678

Newspaz has disabled reputation

Jul 21, 2005, 02:20 PM
Newspaz is offline
Reply With Quote
Scripting language

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

JCF Member

Joined: Mar 2001

Posts: 2,291

n0 is a forum legendn0 is a forum legendn0 is a forum legend

Jul 21, 2005, 02:31 PM
n0 is offline
Reply With Quote
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:
Code:
 Activate Trigger Zone ID 15, Instant death
but, 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 Newspaz's Avatar

JCF Member

Joined: Jan 2001

Posts: 2,678

Newspaz has disabled reputation

Jul 21, 2005, 02:43 PM
Newspaz is offline
Reply With Quote
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.

Code:
import jj2

while 1:
    if jj2.position.player3 == "45,33":
        jj2.control.next_level
** Please note this code is pure fiction.
EvilMike EvilMike's Avatar

JCF Member

Joined: Jun 2001

Posts: 3,478

EvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHART

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

Quote:
Originally Posted by TheOnlyN0B0DY
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

JCF Member

Joined: Mar 2001

Posts: 2,221

Monolith is doing well so far

Jul 22, 2005, 06:41 PM
Monolith is offline
Reply With Quote
Sorry, I don't have any specific ideas, but I am interested in how you're going about with this project.
__________________
<div style="float: right; width: 100px; height: 70px; margin: 5px 15px;"><img src="http://madskills.org/monolith/idleserver.gif" style="width: 98px; height: 65px;"><img src="http://madskills.org/monolith/theserver.gif" style="width: 98px; height: 65px; position: relative; top: -65px;"></div><div style="margin: 0 3em; font-size: 80%; font-style: italic;">Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It is not rude, it is not self-seeking, it is not easily angered, it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres.</div><div style="text-align: right; text-size: 80%;">1 Corinthians 13:4-7</div>
Newspaz Newspaz's Avatar

JCF Member

Joined: Jan 2001

Posts: 2,678

Newspaz has disabled reputation

Jul 23, 2005, 06:57 PM
Newspaz is offline
Reply With Quote
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 Newspaz's Avatar

JCF Member

Joined: Jan 2001

Posts: 2,678

Newspaz has disabled reputation

Jul 26, 2005, 06:08 AM
Newspaz is offline
Reply With Quote
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 ShadeJackrabbit's Avatar

JCF Member

Joined: Apr 2005

Posts: 1,342

ShadeJackrabbit is doing well so far

Jul 26, 2005, 03:11 PM
ShadeJackrabbit is offline
Reply With Quote
I agree with URJazz
__________________

Stop talking sense, this is an internet argument. ~Doubble Dutch
Link Link's Avatar

Untitled

Joined: Apr 2001

Posts: 2,099

Link is doing well so far

Jul 26, 2005, 04:56 PM
Link is offline
Reply With Quote
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.
__________________
With our extreme gelatinous apology,
We beg to inform your Imperial Majesty,
Unto whom be dominion and power and glory,
There still remains that strange precipitate
Which has the quality to resist
Our oldest and most trusted catalyst.
It is a substance we cannot cremate
By temperatures known to our Laboratory.

~ E.J. Pratt
 
EvilMike EvilMike's Avatar

JCF Member

Joined: Jun 2001

Posts: 3,478

EvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHART

Jul 26, 2005, 06:15 PM
EvilMike is offline
Reply With Quote
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

JCF Member

Joined: Mar 2001

Posts: 2,221

Monolith is doing well so far

Jul 26, 2005, 09:56 PM
Monolith is offline
Reply With Quote
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.
__________________
<div style="float: right; width: 100px; height: 70px; margin: 5px 15px;"><img src="http://madskills.org/monolith/idleserver.gif" style="width: 98px; height: 65px;"><img src="http://madskills.org/monolith/theserver.gif" style="width: 98px; height: 65px; position: relative; top: -65px;"></div><div style="margin: 0 3em; font-size: 80%; font-style: italic;">Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It is not rude, it is not self-seeking, it is not easily angered, it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres.</div><div style="text-align: right; text-size: 80%;">1 Corinthians 13:4-7</div>
Newspaz Newspaz's Avatar

JCF Member

Joined: Jan 2001

Posts: 2,678

Newspaz has disabled reputation

Jul 27, 2005, 11:40 AM
Newspaz is offline
Reply With Quote
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

JCF Member

Joined: Apr 2001

Posts: 151

mirrow has disabled reputation

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

but nm :P
Newspaz Newspaz's Avatar

JCF Member

Joined: Jan 2001

Posts: 2,678

Newspaz has disabled reputation

Aug 1, 2005, 02:48 PM
Newspaz is offline
Reply With Quote
Code:
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 EvilMike's Avatar

JCF Member

Joined: Jun 2001

Posts: 3,478

EvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHART

Aug 1, 2005, 08:39 PM
EvilMike is offline
Reply With Quote
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.
laffer

JCF Member

Joined: Aug 2005

Posts: 49

laffer is doing well so far

Aug 11, 2005, 08:46 AM
laffer is offline
Reply With Quote
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

JCF Member

Joined: Aug 2005

Posts: 49

laffer is doing well so far

Aug 11, 2005, 10:37 AM
laffer is offline
Reply With Quote
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

Btw, have Epic said anything about releasing the source code to this game?
LittleFreak LittleFreak's Avatar

JCF Member

Joined: May 2004

Posts: 4,190

LittleFreak is doing well so far

Aug 11, 2005, 10:39 AM
LittleFreak is offline
Reply With Quote
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.
__________________
Sober again. Still love it.
laffer

JCF Member

Joined: Aug 2005

Posts: 49

laffer is doing well so far

Aug 11, 2005, 10:51 AM
laffer is offline
Reply With Quote
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 LittleFreak's Avatar

JCF Member

Joined: May 2004

Posts: 4,190

LittleFreak is doing well so far

Aug 11, 2005, 10:54 AM
LittleFreak is offline
Reply With Quote
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. )
__________________
Sober again. Still love it.
Grytolle Grytolle's Avatar

JCF Member

Joined: Sep 2004

Posts: 4,126

Grytolle is a forum legendGrytolle is a forum legendGrytolle is a forum legend

Aug 24, 2005, 11:57 PM
Grytolle is offline
Reply With Quote
I think auto-downloading scripts could be sort of a security threat...
__________________
<center></center>
EvilMike EvilMike's Avatar

JCF Member

Joined: Jun 2001

Posts: 3,478

EvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHART

Aug 25, 2005, 02:56 AM
EvilMike is offline
Reply With Quote
Quote:
Originally Posted by Grytolle
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.
Old Nov 4, 2005, 04:01 AM
R3ptile
This message has been deleted by Link. Reason: If you revive a thread, please make it clear why. This looks like spam.
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 02:56 AM.