Scripting Reference

Subscribe to Scripting Reference 262 posts

Sign in to reply


 
avatar for urbansquall urbansquall 57 posts
Flag Post

We’re going to be posting a lot more information on scripting in Battalion, but for now you can check out the Scripting Reference to get an idea of what the system is capable of:

http://www.urbansquall.com/blog/wp-content/uploads/2009/07/battalion_scripting_reference.pdf

 
avatar for JohnnyCrunk JohnnyCrunk 57 posts
Flag Post

I really love what you did with the map editor and especially like how you added a scripting feature as well. I even expect to see user-made campaigns being created later in the future. I tried it myself and it is definitely a very useful tool. I have, however, found many problems where certain conditions/responses do not work properly but they are too many too list. It is not a big deal at the moment but after Beta I really hope the scripting is fixed and even improved.

 
avatar for urbansquall urbansquall 57 posts
Flag Post

It will be Johnny, it’s just not something we’re focused on at this point.

 
avatar for Jabor Jabor 11382 posts
Flag Post

Suggestion: Have an output console which shows messages from trace responses. Making it useful for debugging complex scripts.

 
avatar for Bazooka_Uka Bazooka_Uka 11 posts
Flag Post

This script feature is truly awesome. I can see huge possibilities!

Right now, I’m working on creating a Scorpion Tank v2.0, which can move twice per turn. However, I’m stuck. I’ve made a counter that increases by one every time the tank moves, and I would like to create conditions so when the counter reaches 1, unitDisable is false, thus giving the tank another move, but you can only specify units on unitDisable by location, instead of name. That would be a great addition. Also, I need the counter to go to 0 at the start of every turn, but since there is the possibility that the player will not move the tank twice, using decrementCounterVariable could get the counter into negatives or otherwise mess things up. Therefore, I think another great idea would be the ability to make a response where you change a counter to an integer rather than increasing it or decreasing it by an integer.

I’m not trying to nitpick or anything, this is an amazing feature and I know it’s in alpha. Hopefully I’m helping out with this and not just being annoying (I could also be overlooking some obvious way to get my idea working; I’m a noob at this). Great work!

 
avatar for Terabyte324 Terabyte324 161 posts
Flag Post

This looks interesting but I have a little question. In the appendix in the terrain names section there’s desert, canyon, wasteland, and volcano, are these new terrain tiles you’re developing or something?

EDIT: I read everything and then tried to make a simple script where Argent pops up at the beginning of the game and says “Testing, testing, one two three…hello?” but it didn’t work.
This is the script
http://tinyurl.com/mexa4r

 
avatar for urbansquall urbansquall 57 posts
Flag Post

A less irritating way to share snippets: http://www.copypastecode.com :)

We’ll be doing a lot to give how-tos for scripting and creating new scripting conditions and responses so people can tweak the game every which way you want, but right now we’re focusing on getting everything else going 100%.

Bazooka: That’s a pretty cool idea, I never even thought about trying to use the scripting that way. I don’t think it’s possible just yet, but I think we will be able to in the future.

Terabyte: We’ve got a couple new terrain tiles we’re working on. Again, they’re not in the core experience so we’re holding off releasing them until everything else is good to go (which will be soon!).

 
avatar for Terabyte324 Terabyte324 161 posts
Flag Post

Thanks for the website urban, I edited my post so it has the tinyurl it gives you so people can see my code because I have no idea what’s wrong with it. Another little problem/question, so I’m in the map editor and I put my code into the script menu, then I hit test to see if it works which, it doesn’t, but when I forfeit and go back to the editor and click on the script menu my code has disappeared. Is there something special I have to do to make it stay there or something?

 
avatar for YAYitsAndrew YAYitsAndrew 26 posts
Flag Post

It looks like you’ve got some typos. “start game” should be “startGame”, and “disablecontrollers” should be “disableControllers”. Scripting, like most programming, is very picky about spaces and capitalization.

Part 3 of our scripting tutorial at urbansquall.com deals specifically with chatting, so it should be a good example for you to follow.

http://www.urbansquall.com/blog/2009/07/31/game-scripting-part-3-the-guide/

 
avatar for Terabyte324 Terabyte324 161 posts
Flag Post

Thanks both of you, I finally got it to work but I found a bug with the avatars that maybe you guys can work out for the final version. When the avatar value is set to “argent” all you get is a black box but when you set it to “tucker” argent’s avatar comes up.

 
avatar for YAYitsAndrew YAYitsAndrew 26 posts
Flag Post

Thanks I will look into it.

 
avatar for Conquerer95 Conquerer95 2815 posts
Flag Post

You guys are the best, thanks for making this a great game. I loved testing it, and can’t wait for map scripting! :)

!

 
avatar for Terabyte324 Terabyte324 161 posts
Flag Post

Yeah…me again, that bug I reported about Argent and Tucker, turns out I thought Tucker’s name was Argent, but still when it’s set to Argent nothing comes up, just clearing it up though.

 
avatar for Gerk Gerk 37 posts
Flag Post

Here’s my adventure

http://www.copypastecode.com/9193/

This is meant to ‘top up’ the Adv. Oil Refineries to $1000 every turn…but it only fires once, and gets discarded.

 
avatar for iopred iopred 15 posts
Flag Post

Gerk, you can put repeats=“infinite” in the event tag, and the event will happen every turn.

 
avatar for Conquerer95 Conquerer95 2815 posts
Flag Post

I’ve gathered a couple on the links that are spread out across the Battalion:Arena forums. Here is a scripting information directory; it gives a lot of information on scripting, and links to specific scripting locations. http://www.kongregate.com/forums/14/topics/53612

 
avatar for JohnnyCrunk JohnnyCrunk 57 posts
Flag Post

I hope the developers still read through these forums because I need some help on a script that limits units in a map. It should be working but it could be a mistake on my end or a problem in the game script editor. This is the link to the thread I made about the script. A reply in either this thread or the other one I made would be highly appreciated.

 
avatar for ItsColdInHere ItsColdInHere 253 posts
Flag Post

Ok, so im confused as to how the Boolean Variable works, or what it does?

 
avatar for ItsColdInHere ItsColdInHere 253 posts
Flag Post

After you answer that, can you tell me what is going wrong with this script? http://www.copypastecode.com/21184/ It works until I add that createUnit code…

 
avatar for cementblocks cementblocks 91 posts
Flag Post

player value=“^1”

should be

player value=“1”

And try removing the resources value line, I haven’t been able to make a script work with one in it.

 
avatar for ItsColdInHere ItsColdInHere 253 posts
Flag Post

Thanks, You Rock!

 
avatar for ItsColdInHere ItsColdInHere 253 posts
Flag Post

http://www.copypastecode.com/21226/
Alright, sorry to bother you again, but I am trying to make reinforcements (the three scorpion tanks) appear for player two in round ten… and there is some error that is preventing everything except the chat from working… Please help, I really want to finish this map lol…

 
avatar for cccool925 cccool925 886 posts
Flag Post
Originally posted by ItsColdInHere:

http://www.copypastecode.com/21226/
Alright, sorry to bother you again, but I am trying to make reinforcements (the three scorpion tanks) appear for player two in round ten… and there is some error that is preventing everything except the chat from working… Please help, I really want to finish this map lol…

You didnt put it for player 2

 
avatar for gbot gbot 17 posts
Flag Post

I know scripting is still in beta – but any ETA on when scripting will be fixed so we can publish maps with scripts? It’s quite annoying to build a map, put in a script – only to have the map disappear once you save it.

 
avatar for xyklos_servant xyklos_servant 10 posts
Flag Post

Hi guys. I’ve reviewed the pdf reference, and the tutorial on chatting basics. I don’t know of any other Battalion XML reference out there. What are some scripting basics in order to make cooperative games?

Sign in to reply