Tutorial and fastplay conversion
-
Berserk Cyborg
- Code contributor

- Posts: 938
- Joined: 26 Sep 2016, 19:56
Tutorial and fastplay conversion
I took the liberty of converting the fastplay demo into a JS script. Essentially I treated it as a campaign mission and everything is controlled by the campaign library. Like the cam3-4 mission, the gameOverMessage function will probably need to be changed a bit. But other than that not much else to say since it is a pretty bare bones map.
Was going to do the tutorial, but it looks kind of scary and I am not even sure if it is possible with the current JS API.
current work.
Was going to do the tutorial, but it looks kind of scary and I am not even sure if it is possible with the current JS API.
current work.
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: Tutorial and fastplay conversion
Cool!
We've once been thinking if those should be challenges rather than campaigns. It turned out to be complicated because they need to use campaign stats (eg. tech tree), while challenges usually use multiplayer stats.
We've once been thinking if those should be challenges rather than campaigns. It turned out to be complicated because they need to use campaign stats (eg. tech tree), while challenges usually use multiplayer stats.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: Tutorial and fastplay conversion
Cool, indeed!
Could you start making a list of things that are missing in the JS API for the tutorial? Should be easy to fix.
Could you start making a list of things that are missing in the JS API for the tutorial? Should be easy to fix.
-
Berserk Cyborg
- Code contributor

- Posts: 938
- Joined: 26 Sep 2016, 19:56
Re: Tutorial and fastplay conversion
I think these are what needs to be added. I will try listing the functions I see in the WZScripts:
1. removeReticuleButton(button_id)
2. Set the inTutorial flag (bInTutorial?)
3. stopCDAudio() / playIngameCDAudio()
4. addConsoleText()
5. tagConsoleText()
6. toggle flash of a reticule button. flashOn(button_id) / flashOff(button_id)
7. clearConsole()
8. event for when a certain reticule button is pressed
9. event for moving a factory delivery point
10. droid selected event
11. event when a menu icon is selected (think research item / build menu structure)
12. event when a droid design menu icon is selected (ie. vehicle/propulsion/weapon icon)
some others that I saw but probably not needed:
1. tutorialTemplates()
2. setCampaignNumber()
3. set gameLevel
4. setRadarZoom()
5. pause()
1. removeReticuleButton(button_id)
2. Set the inTutorial flag (bInTutorial?)
3. stopCDAudio() / playIngameCDAudio()
4. addConsoleText()
5. tagConsoleText()
6. toggle flash of a reticule button. flashOn(button_id) / flashOff(button_id)
7. clearConsole()
8. event for when a certain reticule button is pressed
9. event for moving a factory delivery point
10. droid selected event
11. event when a menu icon is selected (think research item / build menu structure)
12. event when a droid design menu icon is selected (ie. vehicle/propulsion/weapon icon)
some others that I saw but probably not needed:
1. tutorialTemplates()
2. setCampaignNumber()
3. set gameLevel
4. setRadarZoom()
5. pause()
Last edited by Berserk Cyborg on 02 Dec 2017, 23:34, edited 4 times in total.
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: Tutorial and fastplay conversion
I already have a patch for 1, 11, and 12 in the works, just need to get time to finish it.
I would like to make the inTutorial flag obsolete.
console() isn't enough to replace addConsoleText()?
For 10, we have eventSelectionChanged().
Not sure what some of the others do, I'll have to look into it.
I would like to make the inTutorial flag obsolete.
console() isn't enough to replace addConsoleText()?
For 10, we have eventSelectionChanged().
Not sure what some of the others do, I'll have to look into it.
-
Berserk Cyborg
- Code contributor

- Posts: 938
- Joined: 26 Sep 2016, 19:56
Re: Tutorial and fastplay conversion
Did not know about those... will update the list. Yeah, they both look like what was needed then.Per wrote: console() isn't enough to replace addConsoleText()?
For 10, we have eventSelectionChanged().
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: Tutorial and fastplay conversion
Parts of it pushed. Preview of unfinished remainder: https://github.com/perim/warzone2100/co ... 256a3109bfPer wrote:I already have a patch for 1, 11, and 12 in the works, just need to get time to finish it.
-
Berserk Cyborg
- Code contributor

- Posts: 938
- Joined: 26 Sep 2016, 19:56
Re: Tutorial and fastplay conversion
Causes a crash when loading saves. See viewtopic.php?f=1&p=139167#p139166.Per wrote:Parts of it pushed.
-
Lord_Kane
- Trained

- Posts: 104
- Joined: 24 Nov 2016, 21:51
Re: Tutorial and fastplay conversion
check my investigation results in that thread, logs are there in a 7z file but for convenience I have slapped them here too.Berserk Cyborg wrote:Causes a crash when loading saves. See viewtopic.php?f=1&p=139167#p139166.Per wrote:Parts of it pushed.
You do not have the required permissions to view the files attached to this post.
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: Tutorial and fastplay conversion
Implemented in e26b9516d3e065527e41fe5006f9f94983653882, which adds:Berserk Cyborg wrote: 3. stopCDAudio() / playIngameCDAudio()
7. clearConsole()
9. event for moving a factory delivery point
clearConsole()
hackPlayIngameAudio()
hackStopIngameAudio()
eventDeliveryPointMoving()
eventDeliveryPointMoved()
-
Berserk Cyborg
- Code contributor

- Posts: 938
- Joined: 26 Sep 2016, 19:56
Re: Tutorial and fastplay conversion
Awesome! Updated the list again.
Looks like you got a copy paste oddity with the debug messages in those two.Per wrote: hackPlayIngameAudio()
hackStopIngameAudio()
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: Tutorial and fastplay conversion
Berserk Cyborg wrote:Looks like you got a copy paste oddity with the debug messages in those two.
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: Tutorial and fastplay conversion
Added in 2810c730e1733262b3ff27decfbb93c1db821a6a (and earlier): 1, 6, 8Berserk Cyborg wrote:I think these are what needs to be added. I will try listing the functions I see in the WZScripts:
1. removeReticuleButton(button_id)
2. Set the inTutorial flag (bInTutorial?)
3. stopCDAudio() / playIngameCDAudio()
4. addConsoleText()
5. tagConsoleText()
6. toggle flash of a reticule button. flashOn(button_id) / flashOff(button_id)
7. clearConsole()
8. event for when a certain reticule button is pressed
9. event for moving a factory delivery point
10. droid selected event
11. event when a menu icon is selected (think research item / build menu structure)
12. event when a droid design menu icon is selected (ie. vehicle/propulsion/weapon icon)
Added in 629d43771b4ab621fcedb8403165f7557b235bdf: 11, 12 (I think all covered now?)
If 5 is really needed, I think it should handled by an extra, optional parameter to console(). Let me know if this is needed, and what other things this should do.
Number 2 is already handled by setTutorialMode(true);
If tutorial is converted as well, then the move away from the old wzscript would be almost complete, which would be a momentous achievement!
-
Berserk Cyborg
- Code contributor

- Posts: 938
- Joined: 26 Sep 2016, 19:56
Re: Tutorial and fastplay conversion
Yeah, there are still those weather and fog scripts still being used for multiplay/campaign in the base/script/text directory. I know the weather stuff can be ported over, not sure if the fog functions are useful anymore. They also use the setCampaignNumber().Per wrote: If tutorial is converted as well, then the move away from the old wzscript would be almost complete, which would be a momentous achievement!
I guess after that only tech level research enablers for skirmishes are left and Nexus AI.
-
Berg
- Regular

- Posts: 2204
- Joined: 02 Sep 2007, 23:25
- Location: Australia
Re: Tutorial and fastplay conversion
On a side note still within topic can a tutorial be added to show new player about unit orders if its not already in the tutorial.
I think this will rectify other issues for newbies that don’t know about orders and remove the idea that new folks cant find units orders.
I think this will rectify other issues for newbies that don’t know about orders and remove the idea that new folks cant find units orders.