aegisrunestone wrote:
A separate script? So, something like...
when I receive [BeginPatrol] forever if touching (Wall) turn cw (90) degrees move (-10) stepsLike that?
don't make wall a variable, use the sprite "wall"
when I receive [BeginPatrol] forever if touching [Wall] turn (90) degrees move (-10) steps
Offline
Um... yes, that's what I did. I didn't know how to put it up in code here as a sprite. But, I DID use a sprite.
Offline
Sonicfan, did you ever get your version of the game built?
Offline
I'm working on it, but it's a bit more complex than I thought. I should have it done soon, don't worry.
Last edited by sonicfan12p (2012-04-16 10:45:17)
Offline
Yeah, it's very complex. XD
Offline
Okay, here's what I have so far now.
Guards will chase you, unless you're behind a wall, then they just ram into the wall repeatedly.
http://img256.imageshack.us/img256/5395/acguard2.gif
Oh yeah, I added a script that's not in that image. It basically bounces the guards off Ezio if they are touching him.
http://img841.imageshack.us/img841/650/ezioscript.gif
And this is Ezio's insanely long script.
The game basically works. The only issues I have is:
1) Guards don't chase you properly.
2) Collision detection between guards and Ezio stinks. Making it hard to die.
3) Haystacks don't work (and I can't figure out how to make them work).
Any ideas?
Offline
Okay, it's done! Here it is. I hope this helps!
Offline
That's AWESOME.
But the Haystacks don't work. I tried to hide in one, and the guard still chased me.
Offline
Oh, okay. The haystacks do work as long as you HOLD the space bar key.
Is there a way to make it so if you just press the space bar key that Ezio hides until you press it again?
Offline
Maybe add a variable called hidden?
Then at the start of the patrol where it has if detected = 0 and patrolling = 1 add and hidden = 0.
Put elsewhere when touching haystack hidden = 1.
Of the code I saw in the images I didn't see anything for the haystacks?
Offline
Ah, downloaded that other project and that does have a hiding variable.
To make it hide just when clicked get rid of the not key space pressed part.
You'll have to make it so that when you move it sets hiding to 0 though or that you cant move while hiding and pressing space again sets it to 0.
Offline
aegisrunestone wrote:
Oh, okay. The haystacks do work as long as you HOLD the space bar key.
Is there a way to make it so if you just press the space bar key that Ezio hides until you press it again?
I thought about that, and I tried to make it work, but if it is possible, it's a whole lot more complicated than I have time to accomplish it.
Sorry.
Offline
aegisrunestone wrote:
Oh, okay. The haystacks do work as long as you HOLD the space bar key.
Is there a way to make it so if you just press the space bar key that Ezio hides until you press it again?
Here:
Link to Project
Offline
BetaSmozzick wrote:
aegisrunestone wrote:
Oh, okay. The haystacks do work as long as you HOLD the space bar key.
Is there a way to make it so if you just press the space bar key that Ezio hides until you press it again?Here:
Link to Project
COOL! I'll put that into my project ASAP.
Offline
http://img692.imageshack.us/img692/2063/acguardenhanced.gif
Okay, I'm having problems, note the guard's starting position. Now, he goes flying down the screen and off the level into the corner and stops. He does chase Ezio--sortof--but he's stuck. How do I fix this?
Offline
Hard to say without being able to see the project, sorry.
Not sure if its relevant but try double clicking the green flag when you start the project.
Offline
That doesn't do a thing to help me.
Hang on, I'll upload the project to one of my sites and I'll post it here later.
Offline
Ok, post when its uploaded and I'll check it out.
Offline
http://therunestonelibrary.com/storage/AcCTFAVSGB.sb
Here it is.
Offline
Uhh... o.o
Offline
Downloading now to check it out. Was ill recently, sorry.
Offline
SOLUTION BELOW
Ok so here's whats happening:
First, the bug is this:
Guard 1 appears and falls down the left hand side.
The reason is this:
It's start y location is 33.
Going straight into the first bit of the code it says to change y by -5 until y > 35. This never happens so the guard gets stuck into a loop where it falls forever.
The fix:
Change one of the if statements conditions.
In depth fix is below.
---
EDIT: OK, trying to apply that fix now and its troublesome o.O
EDIT2: OK, got it patrolling.
Remove the set y to 33 and -100 blocks, unless you can work out how to apply them properly here unlike me.
Set the top if to y posititon < -100.
Done.
Last edited by BetaSmozzick (2012-04-20 13:21:03)
Offline
Thanks! That works great!
Another problem: the guard won't chase Ezio, though, when he gets in range.
Offline
Nearly certain that that's because you didn't put code in for that guard. I'll check, though.
EDIT: Ok, it's an IF statement problem again.
In BeginPatrol on guard1 you:
1. check if detected is 0 or ezio is out of range
That's fine
2. check if detected is 1 and ezio is within range
The problem here is either that the AND should be an OR - I don't think it's this
or that you haven't coded in a way to make detected = 1 - this seems like the problem
---
In fact I think you could fix it by removing the bit that says AND distance to ezio < 100 but leave in the detected check.
Then above the 2 current IF statements put in:
if <(Distance to [Ezio v]) < [100]> set [Detected v] to [1] endOK the idea above wouldn't quite work with an if else because its use for all of the guards...not sure how to fix that...instead just use the distance to ezio < 100 thing instead of detected, maybe?
Last edited by BetaSmozzick (2012-04-20 22:41:35)
Offline
Okay, I'll try that.
BTW: How do you edit posts?
Offline