Jump to content
  • Advertisement
Sign in to follow this  
ChristianFrantz

scripting with xna

This topic is 2116 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know c# is a scripting language and xna already has a game loop, but would it be of any use to learn a second scripting language?

For example, if i click a button that sends troops to an area, could i call a script that does the movements with ai pathfinding? Or would it save me some work to just create a method within the game?

Share this post


Link to post
Share on other sites
Advertisement
are you sure? I don't think c# is a scripting language.
lua, python,ruby that are scripting languages.

c/c++, c#, java and pascal and so on are normal programming languages.
so from that point of view i would say yes you should learn a scripting language
they are quite useful especially for prototyping, it's really quick to write programs
with them and make the live often easier.

Share this post


Link to post
Share on other sites
so to answer your question: your example is better you implement it directly but for example if you have different characters which own their own behaviour it would be easier to decouple that from your code into a extra script. why i would prefer that way because now I can change my code without destroying any routines of the script.

Share this post


Link to post
Share on other sites

You can use c# to script in unity, so i thought it might be considered one.
C# with xna is so simple that using another language for testing features seems like more of a hassle


okay than sorry, that i really didn't knew. ^^ of course nthen you don't need an extra scripting language if in unity already is

Share this post


Link to post
Share on other sites
okay maybe should wake more up ... you use xna not unity, right?

if xna has no own script language depends on your design and program, add a language
esle hard code everything (only small programs get they nbig I prefer to use two languages even it's more work at the beginning ) Edited by exOfde

Share this post


Link to post
Share on other sites

Your question is hard to answer. It really depends on your situation.

 

If your project is small, like a prototype or a really simple game, you can go ahead and hardcode these actions, since it'll probably be easier than integrating a script module/class/megamoth.

 

Still, seeing you are using XNA and, assuming you did not pay Kharon his coin microsoft the fee to use C++, you are probably already using C#. So there'd be little cost to integrate some sort of scripting within C# itself.

 

If that's the case, it can be worth it using script even for small games you come to create, as it gives you the ability to bulk up content, making you life easier; and maybe even allow modding of your game, what adds years to it's lifespan and loads of potential fans.

 

As a side note, even C can be used for scripting in your games, if you are crazy enough to write an interpreter for it (or find one on the web). That said, C# is not a scripting language, since it was conceived for something else. But it can be a scripting language if you want it to.

Edited by dejaime

Share this post


Link to post
Share on other sites

Good to hear it is not a small project, but this also means you are really better off using scripting.

 

If you need to test some stuff and can't really integrate scripting to your engine now, you could plan an interface and start using hardcoded stuff. When it start to get too troublesome, you can implement it, ideally, without many changes on the rest of the code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!