There are currently 50 players online.
 
Warsow


 
 

backMap Scripting

Posted by
Post Scroll to bottom
MagusZero
Chaotician
(1858 posts)

I've had this idea for a while, but haven't had a good example of why its needed until recently, when Zebus made his camera.

My thought is that Warsow could load map-specific AS the way it loads gametype-specific AS. To differentiate them, I propose the directory basewsw/progs/maps, under which would be placed .ms/.md/whatever other file extension we decide on. This would function as a .gt file does for gametypes, and would be named after the map using it.

The result is that maps would be able to load specific AS classes for use within the map. Zebus' cameras and more robust elevators are simply the beginning. You could also theoretically set up news tickers which read text from a file; you could even have something change that file realtime perhaps, allowing live data to be streamed in maps.

The potential downsides are that AS entities aren't antilagged, possible performance issues with many entities, and that people could override a map's entities if they really wanted to.

To address the first, even current elevators aren't antilagged, and that hasn't caused any major problems yet. Second, performance should only be considered secondary at this point; the potential gain outweighs it. Third, though someone COULD theoretically override a map's entities, replacing cameras with turrets, or disabling elevators, this can only be done serverside, which mitigates the downsides.

This is only the beginning. Please, O Great Community, help me devise more amazing environmental entities; for truly I tell you, should this come to be, not even the sky shall be OUR limit!

jihnsius

<3<#<3
(595 posts)

The biggest problem I see with this is it would be hard to make this pure.

MagusZero
Chaotician
(1858 posts)

I'm not sure I really see the problem tbh; the scripts are only ever loaded by the server. You'd only have to worry about particular servers messing with things, and even then it'd mostly just be cool.

crizis

Mad Hatter
(4082 posts)

There's more to this than the things I mentioned @ IRC.

However, we've talked about this with Vic, but can't promise anything quite yet.

jal

master of the universe
(10599 posts)

Entity scripting itself isn't hard to implement. There is a conflict with how gametype scripts are loaded, tho, and it is that entity scripting requires entities readed before the scripts, and gametype scripting requires scripts readed before the entities because the gametype scripts can define map entities. This isn't a minor issue, it's a serious conflict.

MagusZero
Chaotician
(1858 posts)

Hmm, that makes sense. The way I'm looking at it is to load the map script just before the things declared in any given .gt, in the same way, but considering my lack of knowledge about the engine itself, my ideas may be disjointed from feasibility.

crizis

Mad Hatter
(4082 posts)

jal wrote:
Entity scripting itself isn't hard to implement. There is a conflict with how gametype scripts are loaded, tho, and it is that entity scripting requires entities readed before the scripts, and gametype scripting requires scripts readed before the entities because the gametype scripts can define map entities. This isn't a minor issue, it's a serious conflict.


What we talked about Vic was to allow _completely isolated_ separated scripts for maps which could not be loaded from GT scripts.

crizis

Mad Hatter
(4082 posts)

And to add:

There's also problem of this making a pretty hard deadlock for our AS API, right now making changes is pretty minor problem as we maintain our gametypes, and there's just handful of popular community gt scripts - but if this would spread out to maps, then it would become a maintainance nightmare.

But I'm still in favor of it, it would really bring to our engine/map capabilities to whole new level (for projects outside Warsow :))

m0t0

Member
(843 posts)

this idea sounds good on paper but i dont think it will have much use and people dont find it that cool in game

MagusZero
Chaotician
(1858 posts)

Neither does having nice texturing and lighting... Don't be stupid.

jal

master of the universe
(10599 posts)

crizis wrote:
jal wrote:
Entity scripting itself isn't hard to implement. There is a conflict with how gametype scripts are loaded, tho, and it is that entity scripting requires entities readed before the scripts, and gametype scripting requires scripts readed before the entities because the gametype scripts can define map entities. This isn't a minor issue, it's a serious conflict.


What we talked about Vic was to allow _completely isolated_ separated scripts for maps which could not be loaded from GT scripts.


Ye but you have to run it in a second AS engine which is pretty much the same thing but repeated. I obviously didn't meant it couldn't be done, but that conflicts make it much more work than it should be.

Vic

Member
(4892 posts)

Obviously the map scripts would be limited to avoid conflicts with GT scripts if run in the same engine. Just basic entity spawn functions for custom classnames + 1 global function for initialization with some fixed-name, I think.

learn_more

Member
(3317 posts)

most stuff seems to be hardcoded with only one engine instance in mind..

Vic

Member
(4892 posts)

Just committed this:

A hacky implementation of map scripts. AngelScripts are loaded from "progs/maps/mapname.mp" project files, containing the list of includes (GT scripts are loaded in the same way). Each map can implement spawn functions for custom entities and 4 hooks with hardcoded names:
- void MAP_Init() for map initialization
- void Map_Exit() for map shutdown
- void Map_PreThink() - function which will be called before any world entity has had its think function called and physics run for this frame
- void Map_PosTthink() - function which will be called after all world entities have had their think functions called and physics run for this frame


Note that the implementation is somewhat hacky due to angelwrap API limitations and may not work correctly in 100% cases.
(updated 2012-09-17 21:14:49)

MagusZero
Chaotician
(1858 posts)

I am incredibly happy right now :D


Scroll to top



RSSRSSRSSRSS

Copyright © 2013 Chasseur De Bots

Warsow in social media



Warsow is an indie game developed by group of hobbyists. Please consider giving us a small donation: