2013-01-07 05:12:27

Hello guys! I'm trying to work on this scs, but I'm not very experienced with programming. Can someone give me a hand on solving my location events issues?
map=multi1
starting gear
level=10
d=270
quest=talk to the guard.
say=Guards are looking for survivors brave enough to go out there and find things to help the safe zone. If you are one of these brave ones, say an hello to Hary.
block chat event=Hello
say=Hary tells you: If you really want to be a soldier to help out the safe zone, I need you to assign some papers. I know it sounds senseless in this kind of situation, but we must say that we can not assist you during your work.
quest=go grab the papers at the defensive room.
end event
add item 1 218,32,219,32 -papers
block pickup event -papers
quest=Bring back the files to start your life as a real soldier.
end event
block donate event -papers
say=Hary smiles and sais, Well done. Now to your equipment. There are some boxes at the storage. Take one of them and be careful, we don't have more of these weapon to aid you.
play sound Items\note.wav
end event
add item 1 240,47,240,48 -supplie box
block pickup event -supplie box
quest=This must be the box. Bring it to Hary.
end event
block donate event -supplie box
give item 1 Glock 17
say=Hary sais, You got the glock 17, it will help you against the zombies. Now go see if the guards outside are in need of help.
level up
end event
block location event 213,213,51,29
set music=Music\Lastman.mp3
put sound 208,47 Voices\11\medic.wav
end event
block location event 213,213,51,29
add spot 213,213,51,29 Tyrant=6
put sound 208,47 Voices\11\hurt.wav
put sound 208,47 Voices\11\hurt.wav
end event
\\"The sound hurt.wav really shoud play 2 times.
\\"My location events aren't working. But it doesn't seems to be totally wrong, because the campaign is working so far.
Well, thats my work so far, I know its too simple for compared to what the current scs allow us to do. But I must first understand how to do the basics.
Best regards, Haramir.

The true blind is the one who refuses to see.

2013-01-07 05:33:32

Haramir, your location events are not working because you have the coordinates typed in reverse order.  You must start with the top left corner and end with the bottom right.  You have it backwards.  The 2 voices are both playing but they are being executed one right after the other so the sounds are just overlapping each other perfectly.  If you want some sort of gap between them then you would have to use a timer.

I'd type more but I only have the internet for a few minutes.  I've written a lot of new code today but it's still too buggy to post.  I'll try to have a client update tomorrow.

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

2013-01-07 06:13:22

In addition, and maybe you want it this way, but your generating the box is outside of any events so it will happen once the campaign loads. I only mentioned this because it is between two events, as though you had meant to put it in one but reversed two lines. Again, any line not in an event will execute as soon as the script loads.

2013-01-07 09:52:31

Hi.
wow. Damn the Swamp topic and this topic have grown huge the short time I've been away from the forum.
A huge thanks goes to aprone, Mehgcap, Anaconda, Sneak and others who have helped me solve my issues, and helped me to understand how it all works. I spend the half of last sattorday on scripting, writing a storyline, bug fixing and trying to understand how it all works. Yesterday I was busy with lots of other things. sad
Well, aprone, I don't understand why I shouldn't stop the timer when using it for telling messages in my story. Let's say I start my story with something like 5 messages to split it up. then a lot of stuff happens like kill zombies, search for items etc. Then a new cutseen plays with scrolling messages again. If I don't stop the timer, how should I then use the same timer? If I understand this correctly, the timer keeps running if I don't stop it, and I would never know how much time players spend on completing quests etc.
I have thought about making something where enter sends the next message in the story, but that won't work in the safe zone, so I don't know how to make that useful for everyone. smile
So, I think the only thing I don't understand now is custome variables, but I'll get into that when needed. smile I just need to solve a few bugs in my campaign and add some more to it, and then I can't wait to hear what you think about it. smile

Best regards SLJ.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Facebook: https://facebook.com/sorenjensen1988
Twitter: https://twitter.com/soerenjensen

2013-01-07 09:53:56

aprone might you look at the lure code, I believe it is still not working.
I've done several tests with it and it doesn't seem to be lureing the zombies anywhere, I've made the lure go off ten tiles away from the zombie at 100 radius/lure power whatever it is, and it doesn't seem to react to it, i've done it at 20 tiles 30 40 60 and 100 tiles and it has no affect on the zombie what so ever. The zombie is spawned before the lure so as i understand it it should be affected by it.
Also it doesn't seem to be accepting custome variables for the lure radius part of the command. where in your guide is has one at the rasius.
I sent you my code and since then i've changed it around, i've made it to where the lure is fired off every 5 seconds at the coordinates i provide through updating the variables with the timers. Still nothing though.

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 09:55:40

SLJ, that's exactly why I turn off  my timers after they're done with being used hee.

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 10:38:25

Thanks guys, it seems to be working now!
Best regards, Haramir.

The true blind is the one who refuses to see.

2013-01-07 10:48:20

Hi,
As Aprone said, the only time you need to turn off your timers is when you don't want to use them anymore. In every other situation, your events will continue to trigger, as you set them up. e.g. at 1 second, 10 seconds, 20 seconds, etc, for a story.
Also, you can set them to any arbitrary time.
The reason why timers should not be stopped had popped up because of a code example where someone stopped and started the timer in a timer event.

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-07 11:08:36 (edited by SLJ 2013-01-07 12:52:06)

ah, I see. Lol. Yeah that was me who messed that up because I thought the timer automatically ran out when an event ended.

Best regards SLJ.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Facebook: https://facebook.com/sorenjensen1988
Twitter: https://twitter.com/soerenjensen

2013-01-07 11:46:00

SLJ, remember that you can always set the timer to whatever you want. So when you need to use it again, just be sure to set it back to 00.
A must for the ghost mode, if implemented, is a way to instantly teleport to a set of coordinates, and I don't think I even need to explain why big_smile

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

2013-01-07 12:57:52

Hi,
Actually, if you have multiple events set for a timer, e.g. one at half a minute, and one at one minute, then both of them will fire without you having to stop and start the timer again.
Thus, you only need to stop the timer, as I said in my previous post, when you are not using it any more. Resetting the timer also does not need a stop and start command.

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-07 16:50:22

I just thought of a way to get the player to recieve items for killing zombies. It's so simple I can't believe I didn't think of it sooner. lol! Something like this:

'scs recipe
block kill event=any
radio=Excellent!
add item 1 [player.x],[player.y] *
end event

Also, just for fun, here's another clever idea I just got:

'scs recipe
block kill event=dire
new var upperX=[player.x]
add upperX by -5
new var upperY=[player.y]
add upperY by -5
new var lowerX=[player.x]
add lowerX by 5
new var lowerY=[player.y]
add lowerY by 5
radio=Uh, oh! Here comes trouble!
no respawn
add spot upperX,upperY,lowerX,lowerY canine=4
end event

2013-01-07 18:00:41

I had a question about the asterisk operator for names. If we use it to generate loot like this:
add items 30 1 [coordinates] *
would that not generate one of the item? That is, if we say to generate 1 9mm ammo, the user literally finds 1 round, not 1 pack of 30 like you'd expect. So, using the above, would the user not then find single rounds, arrows, and shells? Of course it works fine for med kits, weapons, and armor, but for ammo I'm not sure what would happen.

2013-01-07 18:40:24

So, is there any way to replicate the pressing enter to move to new maps seen in multi-player mode? Something like the below, though I know it won't work yet:
block while player.zone1=To climb up press enter and enter event someVar>0
map=multi1
//and so on
end event

Hmm, even if we do get built-in vars working in events, this throws up more problems. First, we'd need a way for comparisons to work on more than just numbers, and second we'd need a way to tell the game when the zone name is over. If there's an "and" in the zone name, I can see a lot of problems, unless the script interpreter can parse based on the right-most instance of the word...

2013-01-07 18:46:44

I'm probably forgetting to reply to some stuff people have said, so my apologies if I have.

Mehgcap, when using the asterisk to generate random items, the client also fills in the amount with the standard amount for the item it randomly becomes.  So essentially, if you're using the * for the item name, you could have used any number for the amount and it wouldn't matter.  I should put that in the guide.

I'm still trying to finish up a few things before I post this next update, but I have figured out the issues with the lure command.  Some changes I've been making to the zombie AI, for a future feature I've been working towards adding, seemed to be conflicting with the lure.

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

2013-01-07 18:56:31

Okay, that helps a lot, I had one "add items" command for every ammo type. smile That's good news about luring (and presumably hunt, though I hadn't tried that one yet). Any idea why while statements don't work?

2013-01-07 20:19:50

Aprone, quick question. I was just reviewing the Swamp code you posted, the snippet describing zombie generation percentages, and I wanted to confirm something. The line:
fate = Int(Rnd * 100) + 1
generates a random number from 0 to 99 inclusive, hence the plus 1, right? That is, the variable "fate" is random and so the zombie distribution is also random, but also follows the guidelines set out by the subsequent if statements. So, you may have more or less that x percent Canines, but you'll always have roughly that number? I'm putting things in terms of a raw percentage now and will post that when I'm done, but I wanted to be sure I had the logic right.

2013-01-07 21:49:17

It might also be a good idea to repost any dropbox links to your campains here, so that people don't have to search the entire Swamp topic when they want to download and test campains that were created before this topic. Sneak, you want to? Did Drew also create something? Mehgcap, did you create a campain? WHoever did, you should repost the links.

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

2013-01-07 21:58:36

Good point, and I'd suggest a tag like with recipes. Maybe we should start any post that has a campaign link in it with
SCS Campaign:
Again, that will make searching for actual campaign links much easier.

2013-01-07 22:51:14

Mehgcap you are correct.  The variable "fate" in that example will become a number between 1 and 100.  Depending on the map, the variable "fate" may have a different range, and then the zombie type to be spawned will have it's own number range that "fate" will be.

I believe I have the next client ready to post, but I'm updating the guide first.  I've discovered that at times, updating the guide ends up being a chore that I put off doing.  I drag my feet because it isn't fun, and as a result the client updates take a bit longer than they ought to.  tongue  Well, I'm off to type some more.  This next update introduces AI controlled allies, but they don't have all of the features they'll eventually have yet.  Still, even as they are, you will be able to use them for rescue themed campaigns.

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

2013-01-07 23:34:21

Yes, each map has its own range (I'm having fun converting the 130 numbers into percentages). I just thought I'd double check, as I don't know VB syntax. I thought Rnd was short for round, but I now see you must call your random Rnd, then cast to an integer with the Int function. Anyway, looking forward to the update.. Come on While statements! smile

2013-01-08 00:08:52

Okay, I have the numbers. If you want your maps's zombie distributions to closely resemble the game, use the below percentages. If you think something's off, by all means, please check my math. I kept the ranges Aprone's code uses, both for the total and for each zombie type, so you can work the numbers just like I did.

multi1, multi2, sub1, and sub2:
Range: 1-130 (inclusive)
Normal: 37.69% (1-49)
Giant: 15.38% (50-69)
Canine: 11.54% (70-84)
Tyrant: 11.54% (85-99)
Stalker: 7.69% (100-109)
Matriarch: 7.69% (110-119)
Reaper: 3.85% (120-124)
Lamprey: 4.62% (125-130)

multi3:
Range: 1-100 (inclusive)
Giant: 4% (1-4)
Canine: 15% (5-19)
Tyrant: 10% (20-29)
Stalker: 10% (30-39)
Matriarch: 10% (40-49)
Reaper: 10% (50-59)
Lamprey: 10% (60-69)
Dire: 31% (70-100)

warehouse maps:
Range: 1-200 (inclusive)
Normal: 9.5% (1-19)
Giant: 5% (20-29)
Canine: 5% (30-39)
Tyrant: 20% (40-79)
Stalker: 5% (80-89)
Matriarch: 5% (90-99)
Reaper: 5% (100-109)
Lamprey: 5% (110-119)
Dire: 40.5% (120-200)

I don't know what the warehouses are that aren't warehouse 4, since those disallow dires. I assume the game uses the same model, but rejects any number that offers up a dire? Of course, if you use this in your script, please don't forget to round the percentages so you don't use decimals. I also can't say how many total zombies there are on each map (Aprone, could you tell us?) Enjoy.

2013-01-08 00:11:29

Well the "while and" statements are officially next on my list to work on, but in the mean time here's the huge update that I've been talking about lately.

Campaign client 13 is now posted.  There is now "god mode" and "mortal mode" to become invisible to the zombies for debugging purposes.

I fixed a bug that prevented the "kill event" from triggering if you had zombie respawn turned on.  I rewrote a huge section of the zombie AI, so I assume the lure command is fixed now.  Now that I'm writing this I realize I never went back for a final test, and I probably should have.  Oh well, LOL!

The random speaking of the guards has been reduced, because it was annoying because of how frequently they spoke.

I put a tip in the guide that warns people against using location events that are set to a specific point.  You need at least a 1 square tile range so that the player has a chance to walk inside of it.

I also put something in the guide explaining that random items fill in their own amount, regardless of the amount you specify.

You can add computer controlled Allies!  At this time they do not fight zombies, so even though you specify a weapon for them, they'll just get slaughtered without putting up any kind of fight.  I'll add that feature when I can.

You can set the voice, speed, mission/behavior, and obedience of each ally if you aren't happy with the defaults.

You can play sounds so that they are played from the ally's location.

A death event has been added, as well as an ally death event.

The "item count" command as been added, so you can easily get a count of how many of some item the player has in their inventory.

New built in variables include [deadzombie.x] and [deadzombie.y].  These tell you the X and Y of where the most recent zombie was killed.  This is especially useful in the "kill event".

If you have allies, you can also use these new built in variables.  They require the ally's name, so lets pretend these are for an ally named Fred.  [ally.fred.x], [ally.fred.y], [ally.fred.hp], and [ally.fred.mission].  This gives you the ally's current X, Y, health, and mission/behavior.

You might wonder why you'd care to read back the ally's behavior setting since you set it yourself with scripts, but actually the player can change it if you've set the ally to be obedient.  There's a section on this in the guide.

I played around with this neat trick while testing, so I'll post it here to hopefully inspire people.  When entering a room with a child that had to be rescued (it was an ally of course), the kid is frightened and mistakes me for a zombie.  I set the ally's speed to negative 30 and its behavior on follow, so that it actually runs away from me.  I have to chase it to keep it from getting killed as it runs outside, and after several seconds a timer changes the speed back to normal and messages play out the story that the child realizes I am not a threat.

With custom voice work included in a campaign, these computer controlled allies will open up a thousand new possibilities for creating insane adventures!  big_smile  I can't wait to see what you guys come up with.

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

2013-01-08 00:18:32

Oh, yes! My main campaign already includes a rescue, but this ally addition will make it a whole lot better...

2013-01-08 00:24:02

Alright Aprone, stop2! I've had enough! Please, quit torturing me when you know I can't test these new updates. It's soooooooo outstanding!!! Thumbs up for this. CAE, can you send the new readme to me?

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