Campaign port to javascript

For AI and campaign script related discussions and questions
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Campaign port to javascript

Post by aubergine »

Awesome, thanks Per. :)

Any chance of using null when no mission timer is set? In JS, -1 == true.

EDIT: getMissionTime() not getMissionTime[r] (as the set function is setMissionTime() )

sorry to be so picky :oops:
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Campaign port to javascript

Post by Per »

So, anyone up for porting data/base/script/text/cam1a-ai.slo and putting its contents into data/base/script/campaign/cam1a.js?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Campaign port to javascript

Post by Per »

Goth Zagog-Thou wrote:This will make me extremely happy.
I aim to please... :)

If you see in latest master, in data/base/campaigns/ there are some files to define campaign starting points, and now allowing you to start in alpha, beta or gamma campaign as you desire. It currently allows you to list up to 6 campaigns here, which will be displayed in the menu system after you click 'New campaign'.

What more is needed?

I need some test material for custom mods. I tried to download your cam4 preview, but the download link did not work...
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Campaign port to javascript

Post by Goth Zagog-Thou »

It should still be there .. although it's for 2.3.9 (from my Dropbox, that is). I'll take a look and see what's what.

I suppose the next question I need to ask is where are some good tutorials on writing Javascript? I gotta learn this stuff if Cam 4 is to have any hope of being on 3.1+ Warzone. Then I'll understand the proper usage and everything. I looked over Nullbot .js and it's rather .. interesting. :P
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Campaign port to javascript

Post by Goth Zagog-Thou »

Download is fixed. Remember it's for 2.3.9 Warzone.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Campaign port to javascript

Post by Per »

For tutorials and docs, see viewtopic.php?f=35&t=4299

How does your cam4 mod load? Does it override the original campaign somehow, and if so, how?
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Campaign port to javascript

Post by Goth Zagog-Thou »

Nope, put it in /mods/autoload (that's the easiest way). It doesn't touch the original at all, although it uses a special dataset (stats, names, etc) for it's stuff. Remember my proof of concept getting that dataset into Cam 1 some months back? I still have all of those files. :P

Windows 7 (and I assume this applies to Vista and Win 8 as well) will need to run Warzone in XP Sp3 Compatibility mode AND as Administrator, otherwise there's an access violation crash. No clue as to WHY, but it's flawless on 'nix systems and doesn't require any special hackery to work on 'nix.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Campaign port to javascript

Post by Per »

I still do not understand how you start cam4. Is it a map mod?
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Campaign port to javascript

Post by Goth Zagog-Thou »

Just click on 'New Campaign'. :)
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Campaign port to javascript

Post by milo christiansen »

If its the same as when I was still helping it overrides the first mission in cam 1 (Last time I new that mission name was hard-coded to be started when you click "new campaign")
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Campaign port to javascript

Post by Goth Zagog-Thou »

Yeah, that's true. I hadn't really thought of it in those terms.
Post Reply