Solid doesen't feel solid

Get help using Construct 2

Post » Wed Jan 08, 2014 6:30 pm

I haven used Constructor two moths actively, and i have started making simple & small RPG-like game. No-turn based, my skill isn't enough for that. (yet?)

Anyway, when i made my version of line of sight to orc. As I dont have perfect english, i didn't uderstand articel about "line of sight" well, i tried to make my own version.

Shortly My Line Of Sight:

Every tick -> orc spawn lineOfSight

Orb -> is overlapping player
add 1 to orc.seesplayer

Seesplayer 1 or more ->
change axis to Player
move orc by (orc.seesplayer/10)

Every 0.5 second & orc.seesplayer 1 or more ->
remove 1 orc.seesplayer


and also logic that lineOfSight is destroyed when it's overlapping wall.

The Broblem Itself

all orcs have behavior "solid", but in this mechanism, if they see me, they can overlap each other! what can i do to fix that?
~~~~Jabutosama
B
14
S
3
Posts: 68
Reputation: 1,439

Post » Wed Jan 08, 2014 8:43 pm

It's hard to tell from what you posted here but from what I understand you are trying to spawn an object in the players line of sight? If this is it and they are overlapping it is because you don't have a detection in place to ensure they don't spawn on top of another instance of that object. Best way to do this is create an invisible spawn object, have it move to where you want when the player has line of sight and then spawn the object on the spawner's location. Have the spawn object check for collisions first before spawning making sure it isn't overlapping another object or the player. There are a few posts on the forum if you search for spawn an object near player.

Also what language do you speak naturally? I know two other languages and can explain in another if you can't understand.
B
9
S
3
G
2
Posts: 51
Reputation: 1,522

Post » Thu Jan 09, 2014 5:08 pm

Naturally i speak Finnish. (ta-da-daah)

i tell cleary that again.

orc spawn his line-of-sight, like bullet, every tick. those disappear after certain distance moved.

If player overlaps that line-of-sight-bullet, orcs change their angles to player's direction, and they start moving. this means that orcs move to your direction, seeking you.

orcs move faster if they have "seen" you more. They stop seeking you if they dont see you within a certain period of time.

there is also small broblem, ALL orcs in the level will notice player, if one does. this means they all start moving, if they notice you...

so, if orcs start to seek you, they can overlap each other if they suddenly move into same point!Jabutosama2014-01-09 17:11:22
~~~~Jabutosama
B
14
S
3
Posts: 68
Reputation: 1,439

Post » Thu Jan 09, 2014 5:29 pm

Why not give the orcs the built in line of sight behaviour and move the orc with a movement behaviour?


for each orc
orc has line of sight to player
system compare two values: distance(orc.x, orc.y, player.x, player.y)<200
-orc set orc.seesplayer : orc.seesplayer+1
-orc set bullet angle : angle(orc.x, orc.y, player.x, player.y)

orc has not line of sight to player
-orc set orc.seesplayer : orc.seesplayer-1

for each orc - orc set bullet speed: orc.seesplayer/10

set the bullet behaviour to bounce of solid and there you go!
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jan 12, 2014 9:35 am

Thanx!

But the core thing is not fixed yet! Orcs can still freely move across solid objects, even though themselves are solid objects.

I have no idea how to fix this.
~~~~Jabutosama
B
14
S
3
Posts: 68
Reputation: 1,439

Post » Sun Jan 12, 2014 10:28 am

I would have to see your capx to help you any further.

If you don't want to share tyour complete capx, please provide a capx in which only the events relevant to the issue are present.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jan 12, 2014 11:28 am

Are you thinking that solid should stop one solid crossing through another solid object?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Sun Jan 12, 2014 2:43 pm

Hey, another Finn here - PM me your question in Finnish and I will try to help you!
Image
B
96
S
36
G
17
Posts: 351
Reputation: 15,903

Post » Sat Jan 25, 2014 11:57 am

okei (huokaus) kirjoitan nyt suomeksi;

kun (kiinte) rkki seuraa sinua, se voi menn kiinteiden kappaleiden lpi. wtf?
~~~~Jabutosama
B
14
S
3
Posts: 68
Reputation: 1,439


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 39 guests