2013-01-06 08:20:00

Hello all,
Over on the Swamp forum page, we've had well over a hundred messages just on Aprone's newest creation: SCS. Since SCS is related to Swamp, but not Swamp itself, some on that forum have been asking for a new topic to use, so I am creating one. Please use this topic for all SCS-related discussion, and leave the poor Swamp topic for Swamp-related material.

A bit on SCS:
SCS (Swamp campaign scripting) is basically a way to create customized adventures that run on the Swamp engine. Using this language, you can place objects on the map to be found, add zombies, give and take away weapons, and even change map attributes (E.G. slam a door behind a player or shatter a window).

Perhaps the most powerful part of SCS is its support for events. Using these, you can cause lines of code to execute only when certain conditions are met, such as when the player reaches a certain score, a timer hits a given time, the player enters an area, no zombies are left on the map, the player fires a certain weapon, and much more.

To download the SCS release, go to
http://www.kaldobsky.com/audiogames/SwampCampaign.zip
Make sure to put the unzipped files (and the one folder) into a folder that already contains Swamp, since this is only the engine. It needs the DLLs, sounds, maps, and other resources the full Swamp release includes.

2013-01-06 13:14:29

A nice addition to creating custom adventures is also CAE_Jones map editor, found somehere on this forum. It allows you to create custom maps which can be used ith SCS as a replacement for the old maps.
Please note, that as of now, there's a slight issue with the map editor. CAE says he is working on an update to fix this, but until he's done that, custom maps created using his map editor should preferably not be used.
@mehgcap
Congratulations for creating, what I suspect, one of the largest topics on the entire forum. If this is used the proper way, this will have at least thousand posts.

Follow me on twitch
And
Subscribe to my youtube
Leave a thumbs up if you like what I write.

2013-01-06 14:13:46

What is the bug you are talking about with cae Jones's map editer? I have no problems making my maps and using it.

The universe is a rain storm. We are droplets sent to quench the problems of the world, yet we are blown sideways by the winds of distractions.

2013-01-06 14:41:32

Well, it's not really a bug. It's more like how Swamp and bgt handles things differently, which obviously isn't a good thing in this case. CAE_Jones map editor starts counting at 0, and Swamp starts at one. So when you place something on the map, they will be one tile off. That's the reason why loot gets stuck in walls and that.

Follow me on twitch
And
Subscribe to my youtube
Leave a thumbs up if you like what I write.

2013-01-06 14:45:12

hey aprone idk if you'll be looking at this forum as well, but hope sooo!
I'm having a problem with the lure command, it doesn't seem to be affecting the zombies in the way that I understand it.
I'm trying to make zombies walk down a street basicly so what i'm doing is with timers setting up new lures for them to follow.
When you create more than one lure does the first one overwrite it? or maybe the lure is only triggered once like a gun shot.
Perhaps I shall try createing an infinant event that trigggers the lure constently and have ti shut off when the next timer is activated.

The universe is a rain storm. We are droplets sent to quench the problems of the world, yet we are blown sideways by the winds of distractions.

2013-01-06 15:07:56 (edited by robjoy 2013-01-06 15:10:09)

Hi,
SCS Quickref updated to v5.
https://dl.dropbox.com/u/2870116/cquickref.html

@Sneak, if you spawn zombies at the start of a road and you lure them to a set position in front of them, etc, I believe they will try to reach that destination by choosing the shortest path possible. If you restrict their movement via walls of buildings, etc, you can achieve the same effect.
Edit: Regarding Cae's map editor, if you leave the top row empty, and start putting borders, walls, etc, from the next row, the position bug should not appear, i.e. the editor's and Swamp's coordinates should match.

Rob

----------
Robjoy, AKA Erion
Visit my site for all the things I do and to contact me.
You can also stop by for a slice of Pi

2013-01-06 16:45:04

Good work on creating the new thread Meghcap!  I kept telling myself to do so but then I'd just find myself posting in the original Swamp thread like everyone else, LOL!  big_smile

Sneak that's a good idea, and something I hadn't thought of, to stop the timer between messages being displayed.  Are you using some kind of enter event or something to enable it again?  Hmm, that might be a cool way to let the player take the time they need to hear each message before hearing the next one.  The code for playing the messages could still be spaced out in timer events, and all you'd need is a simple enter command to start the timer again after each message also stopped it!  Sneak, I'm thinking that idea of yours is going to lead so some cool things in regards to telling longer stories in the campaigns.  smile

Mehgcap, right now when items automatically respawn, they respawn as the same item they were when the player picked them up.  I haven't spotted any easy way I can adjust that yet, but I'll keep it on my list of ideas to add.

Grryfindore, I'm very happy to hear that your campaign is working now.  big_smile

Sneak and Truegamer, actually it isn't about differences between Swamp and BGT, and more just a difference in how the maps are handled.  In CAE's map editor, he set the top left corner to be coordinates 0,0.  In Swamp, I set that to be 1,1, which is something I do in nearly every tile based game I make, sighted or audio game.  This is a little trick that saves an enormous amount of code at other places such as player movement and collision detection.  When moving, you can normally check the tile to your left, or above, to find out if they are walls.  If you are actually standing on coordinate 0,0 then you would get an out of bounds error with your arrays try to read -1,-1.  The same is true if the left and bottom edges of your map are also at the limit of your arrays.  You end up needing new code to check for those situations before even running the code you run at all other spots on your map, and that seems unnecessary and annoying to me.  I shift my maps to 1,1 and dimension my 2D arrays to 1 more than I need in width and height, so I end up with a single tile thick buffer around my playable map area.  The engine always considers that impassable terrain and now I never need any extra code to keep players from walking off of the map.  So that's the reason behind the numbers being offset by 1.

Sneak, the lure only triggers once like a gun shot, you are correct.  It creates an instant effect that gets the attention of the zombies and they head to investigate it, unless they were already chasing the player.  They'd much rather chase a yummy brain-filled player than investigate an unknown sound, Hehe.  Each additional Lure will overwrite the first, but that makes more sense once you do begin thinking of Lure as a quick burst of sound that only the zombies can hear.

It isn't really related to the current questions and comments, but while testing some stuff I threw together some sample script that counts how many coins a player has picked up, using the new command that will be in the next update.  Here's the code, and perhaps it will give you guys an early understanding (and inspiration) on how the new command can be used.

map=lastman0
x=10
y=10
new var coins=0
item respawn
start timer
//fill the map with 50 individual coins
add items 50 1 1,1,[map.width],[map.height] -Coin
//every 10 seconds have this event trigger.  In the event I reset the time to zero seconds so it loops forever.
//The item count command counts the coins the player has in his inventory, and stores it in my variable coins.
+-1+block time event m=0 s=10
item count coins=-Coin
say=You have collected [coins] coins.
set timer m=0 s=0
end event

I have a little time scheduled today for coding, so I hope I can get some great new things added!

Robjoy, thanks again for the quick reference.  smile

- Aprone
Please try out my games and programs:
Aprone's software

2013-01-06 18:47:13

You wouldn't need a timer for story-telling if you use an enter event. When and if vars can hold text this will be a little prettier, but here goes:

map=multi1
x=10
y=10

new var storyParts=3
new var currentStoryPart=0
set var storyParts=3
set var currentStoryPart=0

+-1+block enter event currentStoryPart>=0
//debug=section [currentStoryPart] of [storyParts]
add currentStoryPart by 1
if currentStoryPart>=storyParts then set var currentStoryPart=0
end event

+-1+var event currentStoryPart=1
say=Story, part 1...
+-1+var event currentStoryPart=2
say=Story, part 2...
+-1+var event currentStoryPart=3
say=Story, part 3...

2013-01-06 18:59:58

Hi,
You're right, though I think auto scrolling is a lot more appealing to me, but that's just a matter of taste.
@Aprone, the new count command sounds fun!

Rob

----------
Robjoy, AKA Erion
Visit my site for all the things I do and to contact me.
You can also stop by for a slice of Pi

2013-01-06 19:06:51

Yes, I'd rather have auto-spoken messages. The problem is that so many different synths are out there, at so many different speeds, there's really no way to set up a timer so it will not annoy half of your users. A manual "next story" command seems the best option, or you could cram it all into one huge message.

2013-01-06 19:24:09

ahoy all
the gun known as the QGun is loaded,and is ready to fire. I pick up the gun, point it towards this topic,and out of the kindness of my hands,fire. big_smile
so the Ammo which comes out is...
I have been reading through the story events spoken messeges and timer stuff,which caused me to think,rair I know. tongue
How would one go about setting it so that when ever a key is pressed the next message is played? I suppose its possible to do it through the new enter event which was added,but I understand that only works with the enter key? So, is it actually possible to set some other key.I don't mind it beeing enter at all,but just curious.
Grryf.

Of all sad words of tongue or pen, the saddest are these, ‘It might have been.
Follow me on twitter

2013-01-06 19:35:28

Nope, not yet anyway. You only have access to enter, q, and shift-q, no others. Well, I suppose through some clever trickery you could use the fire key as well, but that would be difficult since the armed weapon would fire. I still wonder what happens to those who change the q or shift-q key assignments in the keyconfig file...

2013-01-06 20:21:37

Hi, Aprone. I'm not sure if you've thought of these things yet, but I've noticed a few "woopsies" in the campaign scripting.

First, when someone levels, the XP does not reflect the player's level.

In the safe zone, it would be nice if players could buy stuff, since they can sell it, and get Rep in return.

Since there's a starting gear command, I think it only fair that there might as well be a fully armed command, since you can set the player to be fully armed from the custom maps settings.

I know this last one would probably be for the main swamp thread, but I'm putting it here anyway, since it would also be nice to have in campaign mode. What about having zombies drop items, like the enemies can do in shades of doom? (That's another game where you fight stuff, made by GMA Games.) Just a thought.

Here's another suggestion. Since we can't do multiplayer in campaign, would it be possible to give guard npc's names, or at least be able to track their movements like other players? Also, it would be neat if we could script the guards to walk around and do stuff like other players would, or even follow the player during specific parts.

If any of this is not explained well, be aware my brain is running sluggishly at the moment, so Lol!

Everyone have a good day.

2013-01-06 20:31:36

MTV, Aprone has said he might add AI players, which would take care of your guard suggestions. I'm not sure what you mean about zombies dropping things? I do like the idea of a fully armed command; if nothing else, it would make it easier to mostly arm a player by fully arming them and then removing some items instead of giving them starting gear and then adding a bunch of stuff.

2013-01-06 21:10:52

He ment that zombies would drop loot when shot.
I wish there was a command to interrupt fire, that way we can include something really funny called jammed guns big_smile or why not a jam command itself? And how about other variable operations, such as devision and multiplication? Are those already supported in a way? And if they're not, it would be nice to have it, just for the sake of having it. I don't know of a good case to use them yet, but I'm sure they'll be used.
Also, as suggested earlier, perhaps a enable purchases from the safe zone command could be added, and commands to control the amount of rep the user has. Say for example, that you might wanna give them a lot of rep after doing something really, really good. Maybe the same for experience? Does someone have more recordings of their adventures yet? Lol I know, there are barrily no adventures out there, so I suppose even less recordings of it, but still!

Follow me on twitch
And
Subscribe to my youtube
Leave a thumbs up if you like what I write.

2013-01-06 21:42:18

Well, you could jam in a way by removing the weapon, then starting a timer and returning the weapon once the timer is done. In fact, you could randomize this by setting a var randomly from 1 to 10, then every x seconds randomly re-assigning it. If the var is a certain value, remove the weapon and start the jam clearing countdown.

2013-01-06 21:53:25

Not so bad. How did you become so smart big_smile Actually, I totally forgot that you could remove items big_smile

Follow me on twitch
And
Subscribe to my youtube
Leave a thumbs up if you like what I write.

2013-01-06 22:00:58

I've done programming before and have a computer science degree, so this stuff is what I like. Now that I think of it, though, we do have a problem: I don't think you can remove or disable the current weapon, only a weapon by name. So there's no way to jam the current weapon the player is using... Hmm...

2013-01-07 00:10:22 (edited by sneak 2013-01-07 00:14:36)

Aprone. I was messing around with my code last night, and For whatever reason I can't seem to get the zombies to move down the street the way I want them too.
I'll send it over skype for you to look at if you don't mind whenever you get the chance.
I put in the infinant loop that causes the lure to go off constantly as well as set up timers to change the lure location and lure power.

I've changed the number of zombies from 160 to 1 so it'll give a better result.
Also, can you add in an affect to make the player not food so zombies don't attack you or notice you, something like a ghost mode.
It would be very helpful to debug or check out what's actually happening on the map with the zombies.

The universe is a rain storm. We are droplets sent to quench the problems of the world, yet we are blown sideways by the winds of distractions.

2013-01-07 00:14:09

Mehgcap, couldn't you just use the firing command?

Follow me on twitch
And
Subscribe to my youtube
Leave a thumbs up if you like what I write.

2013-01-07 00:51:10

Thetruegamer, Certainly, but the weapon will still fire. So, unless you want to tell part of a story with every shot, it is not a practical solution.

Sneak, I love the idea of a ghost mode, so you can move around and make sure zombies are behaving without actually fighting for your virtual life at the same time. I don't know, maybe some text dumps about zombie behavior from the game would be helpful...

At 2 minutes 27 seconds into the campaign, zombies at 10,10 within a radius of 30 moved toward 25,25 for 13 seconds.
Stuff like that. I'm not sure yet, but it's something to think about.

2013-01-07 01:02:20

That wouldn't work. A group of zombies are not just moving to a set of coordinates. Their movement are advanced and it ould be impossible to determine which data to send to the user.

Follow me on twitch
And
Subscribe to my youtube
Leave a thumbs up if you like what I write.

2013-01-07 01:14:17

maybe not their exact movements, but perhaps a specific number of zombies have been attracted to blah blah as the coordinates.
idk, the ghost mode would be more helpful IMO

The universe is a rain storm. We are droplets sent to quench the problems of the world, yet we are blown sideways by the winds of distractions.

2013-01-07 01:14:37

So, I had a thought: coding recipes.
For those who don't know, a recipe is a segment of code that accomplishes a specific task. Users can find this recipe and paste it into their projects in order to perform the task(s) the recipe is intended to perform. For instance, the snippet I posted about pressing enter to cycle through a story would be called a "recipe", since it is for one thing (pressing enter to advance a story line and returning to the start when the story ends) but is not, in itself, a functioning SCS script.

So, here's my suggestion: if you have a recipe to share, please do so. However, please make the very first thing in your post the following line:
SCS recipe: [brief description]
That way, users can do a forum search for the string "SCS recipe:" and get a list of recipes users have submitted. So, if you have a code snippet that does something you think would be useful to other scripters, share it as a recipe. Please be sure to comment the code so it is plain to any scripter what each segment is for and what can and cannot be modified. Examples of recipes might be advancing a story by pressing enter, having a spoken timer, jamming a weapon, running a function on an interval, and so forth. Of course, snippets should be fully tested and functional before being posted.

2013-01-07 04:46:39

a quick note as well.
Is it possible for the campagne client to specify what line of code the error is in.
IT's a pain to go through every line that the error might occur in. so yeah would be extremely helpful

The universe is a rain storm. We are droplets sent to quench the problems of the world, yet we are blown sideways by the winds of distractions.