RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Another question.

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 89
Ookay. I have another problem I can't quite figure out.

I think i'm coming along pretty well with my understanding of switches and variables, but I decided to try something to test my ability. It's stumping me.

Okay, so I have this Stable, where my horsey stays...I decided to see if I could put a mouse in it, a mouse that, not only does he randomly move about the interior of the stable, (that part's too easy) He also will run away from the player when you approach him...hmm...

Well, as I was writing this I tried a few things and got him to do what I wanted....once.  Now, when I touch him he does run away, but his event stops after that, and he won't run away anymore, or even move...how do I get the event to reset itself after it has been completed?
Game: Tears of Kahlandris
|||||||||| Demo = 10%
Click here for game info! http://www.crankeye.com/forums/viewtopic.php?t=4756

******
Rep:
Level 91
you can always set the mouse's event commands in move events to something like:
change moving speed- 4
move: random
change moving speed- 6
move: away from player
move: away from player

mark repeating and "ignore impossible moves"
and the mouse should do the trick, he won't be too wise but that's the easy way...

you can make it so it's always on move away from hero
and you can make a conditional branch checking if the player's x and y compared to the mouse's are "too close for the mouse" and then make move events judging by the results...
that will be harder by far though
holy shit my sig was big!

**
Rep: +0/-0Level 89
hehe, actually while I was replying to another post and messing around with it I figured it out, and I did it pretty much how you said...but it did take me a while to figure out that I had to ad another switch on there on the second page, turing the switch back off...so that he would run away again.

Without it he'll only scurry away once, then he freezes against the wall.  I might do a really n00b switch tutorial explaining how to do it.  Think I should?
Game: Tears of Kahlandris
|||||||||| Demo = 10%
Click here for game info! http://www.crankeye.com/forums/viewtopic.php?t=4756

******
Rep:
Level 91
:roll: i doubt you really need the switch if you do it right but oh well.

and there is a switch tutorial already...
holy shit my sig was big!

**
Rep: +0/-0Level 89
Hmm..

I'm not sure, I think you do need a switch.

Cuz if you set his event command to 'move away from player' the event just keeps moving, hits a wall and stays there.

Like..you need to have a switch to reset the event, so he'll stop running and run away again, if you hit him again.
Game: Tears of Kahlandris
|||||||||| Demo = 10%
Click here for game info! http://www.crankeye.com/forums/viewtopic.php?t=4756

******
Rep:
Level 91
yeah it will hit a wall but if the player comes from above him after he will run away
you simply "locked him in the corner"
possibly your map is a bit small
holy shit my sig was big!

**
Rep: +0/-0Level 89
It's a horsey stable, its supposed to be small.    :^^:

Even so, you still need the switch...

If you trigger the 'runaway' event by touching the mousey, he runs away, and doesn't stop...the event keeps going, so if you go up to the side of him, he won't run away again, because he's still running away from where you touched him the first time.

Thats why I used 'turn away from player' and 'move 1 step forward' six or seven times. he'll run for a few steps, get some distance from me, then the switch resets the event and he continues to scurry around randomly again, searching for scraps of food.   :^^:

So..If i didn't use a switch, and I did have a big map like you suggested, he would just run away off the screen...and then....and then I'd never see him again!   :cry:
Game: Tears of Kahlandris
|||||||||| Demo = 10%
Click here for game info! http://www.crankeye.com/forums/viewtopic.php?t=4756

******
Rep:
Level 91
oh you want him to actually stop from time to time? Xx

you can do it with variables, add special running ways for each condition and all

say para check if the player is 2x, 2y from the mouse then it will run -4x-3y and jump -1,-2 and so on
more... realistic

sort of..

lol why do you bother so much with a mouse ? :P
holy shit my sig was big!

**
Rep: +0/-0Level 89
Just playing around really, and learning. I find the more I play with stuff the more I learn.

Plus wouldn't it just be cool to have a mouse that runs away from you?

You never walk up on a mouse and it just stands there, like "Yeah...I'm a mouse...whatcha gonna do about it?"

Okay, so I think i see what you're saying, I'll try it with that...but I'm not really clear, I don't know what a 'para check' is.
Game: Tears of Kahlandris
|||||||||| Demo = 10%
Click here for game info! http://www.crankeye.com/forums/viewtopic.php?t=4756

******
Rep:
Level 91
make a new event , set the trigger (like hero touch) to parallel process
a para process runs all the time without stucking the game unlike autostart
now, this will use variable storing the y and x of both mouse event and player event (there is a special option for that in variable operation)
right after that you make conditions regarding the position and how far is the mouse from the player and in case one of them is true the mouse will react using move event and selecing the mouse event
holy shit my sig was big!