JazzJackrabbit Community Forums

JazzJackrabbit Community Forums (http://www.jazz2online.com/jcf/index.php)
-   Beyond Jazz Jackrabbit 2 (http://www.jazz2online.com/jcf/forumdisplay.php?f=8)
-   -   why no scripting language yet????? (http://www.jazz2online.com/jcf/showthread.php?t=12792)

EvilMike May 20, 2005 12:12 AM

I vote the syntax is made it look more like a proper scripting language and less like a mangled mIRC script.

Stijn May 20, 2005 05:12 AM

I'd rather see something like choosemusic("filename.j2b", true). Or just
Code:

level.music.file = "filename.j2b"
level.music.loop = true

Which would work in the same way for objects:

Code:

player.position.x = 5
or
player.posx = 5

Though the event trigger system of mIRCscript might be useful:

Code:

trigger WARP_ENTER {
  player.position.x = WARP_TARGET[0]
  player.position.y = WARP_TARGET[1]
  print(PLAYER_ID." warped to ".WARP_TARGET." via warp number ".WARP_ID)
}

Where WARP_TARGET and WARP_ID would be assigned a value automatically when WARP_ENTER would be triggered. PLAYER_ID would contain the id/name of the player that triggered the event (or maybe it should be called OBJECT_ID, if other sprites like enemies could also trigger this). The print() function would output text to the console/spy window.

Just some ideas.

Stijn May 20, 2005 05:28 AM

A special spawning function wouldn't be needed then, you could just do something like this:

Code:

create_object("foo")
foo.position.x = 5
foo.position.y = 9
foo.status.active = true
foo.status.visible = true
foo.gameplay.behaviour = BEHAVIOUR_TURTLE
foo.gameplay.friendly = false
foo.sprite = SPRITE_TURTLE

Would create an enemy turtle at position 5,9. This is a lot more flexible, as it could easily be extended by other properties (foo.gameplay.points for the points it could earn you, foo.gameplay.damage for the damage it takes before dying, etcetera)

Grytolle May 20, 2005 10:32 AM

Let's go for the IRC-commandish way instead, so they can be used in game like (*presses "T"* /kill Chiyu "Server killed you, becasue he wanted to.").

Torkell May 20, 2005 10:56 AM

I'd prefer a VB-style syntax as it's easy to pick up and use. And object-orientated sounds good, as that makes it easy to dynamically drop stuff in.

n0 May 20, 2005 11:37 AM

And this is why there is no scripting language yet. We haven't settled on a script.

Stijn May 20, 2005 12:44 PM

Quote:

Originally Posted by Grytolle
Let's go for the IRC-commandish way instead, so they can be used in game like (*presses "T"* /kill Chiyu "Server killed you, becasue he wanted to.").

Code:

trigger KEY_PRESS {
  if(KEY_ID==116) {
    $allow_respawn = true
    Chiyu.kill($allow_respawn)
    Chiyu.send("Server killed you, because he wanted to")
  }
}


Link May 20, 2005 01:04 PM

I support Monolith's idea of incorporating a scripting language designed for incorporation, such as Python, TCL, or Lua. This would be much easier than inventing (and parsing\interpreting\etc.) our own. However, it's still a good idea to brainstorm function and object ideas like Odin, Bloodrabbit, and sers have been doing.

Realize, though, that we don't have direct access to anything. All properties and actions would have to occur through memory hacking. There is currently no known way of spawning players or objects.

Torkell May 20, 2005 02:40 PM

You could always be fancy, and use the MS Scripting parser thing (and let people write in VBScript or JavaScript). That way all you have to do is provide a bunch of objects for use by the script. Whatever's used should be something designed for this, and not something like IRC syntax (which has its uses but not as a scripting language).

I'd suggest at a minumum Game, Player and Event classes. You could then add subclasses like Baddie, Boss, Weapon, Shield, Food and so on.

Game would be the grand-daddy of them all, and do things like manage game state and provide a method for accessing and adding Players and Events. Player would contain access to the state for a specific player, like health, ammo, gems, coins, etc. Event would contain the event params and location. Child classes of Event could have more specific details, like the current health and location of a baddie.

ImportantGuy Jul 13, 2005 03:39 AM

Completely unrealistic. Not going to happen. Just think about the synching problems between the game network sending a "shot fired" event, and your scripting network doing the same.

(On a side note, if you ARE going to try this, I suggest lua.)

Newspaz Jul 14, 2005 08:59 AM

I'm in favor of what Link says. I'm even considering making such a thing. I've been working with Python quite a bit lately and I like it a lot.


All times are GMT -8. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
JCF © 2001-Infinity Jazz2Online