[RESOLVED]Need some help with this

Started by Sin86, January 16, 2011, 11:16:24 am

Previous topic - Next topic

Sin86

January 16, 2011, 11:16:24 am Last Edit: January 23, 2011, 10:03:44 am by Sin86
Ok, I really like the idea of pushing switches as shown here.

http://forum.chaos-project.com/index.php/topic,1522.0.html

However I want to make it where I can push a block onto a switch tile in order to activate it like how it's being said in this topic here.

http://forum.chaos-project.com/index.php/topic,460.msg6372.html#msg6372

Problem is I can't understand it well. I tried making the rock and switch be event touches but the switch only activates when I step on it, not the block. I tried using a conditional branch and setting a switch command on the switch and putting that same command on the block but when I push the block, that switch is activated and it still won't press the switch unless I get on it. All I want is to have it where ONLY the block activates it. Having it where no matter where I step on it, it won't activate unless the block is on there.

Valdred

Run a conditional branch to check if the block's coordinates correspond to the ones of the trigger. Tell me if you need further help

Sin86

January 16, 2011, 11:35:24 am #2 Last Edit: January 16, 2011, 11:42:50 am by Sin86
Although I know how to run a conditional branch, how do I check(and modify) coordinates onto one?


Actually, I'm going to need an entire step by step walkthrough for this and what command to click on, what numbers to input etc. Basically everything.

Valdred

Here's a video I made for you

Takes too long to upload. Create four variables: Trigger_x, trigger_y, block_x and block_y. Assign corresponding coordinates using the "Character" option in "Control variables."
You then check if these are equal using var == var in conditional branch. Alternatively you can use the script option in conditional branch, with this code:
($game_map.events[id1].x == $game_map.events[id2].x) and ($game_map.events[id1].y == $game_map.events[id2].y)

Exchange id1 and id2 with proper IDs of the two events.

Sin86

January 16, 2011, 02:35:57 pm #4 Last Edit: January 16, 2011, 02:38:54 pm by Sin86
So as an example, my block is ID 12 and my switch is at ID 9. To get this to work? Do I do it like this?

This is in the script that you posted. Trigger x(12), trigger y(9), block x(12), block y(9)

Or is that incorrect?

Valdred

[] instead of ()

Just hold ctrl while pressing the keys and you'll get 'em

Sin86

January 16, 2011, 02:42:46 pm #6 Last Edit: January 16, 2011, 05:51:21 pm by Sin86
Here is what I did.

($game_map.events[12].x == $game_map.events[9].x) and ($game_map.events[12].y == $game_map.events[9].y)


Block is ID event 12, switch is event ID 9 but when I push the block(12) onto switch(9). Nothing happens.


Never mind, I finally got it. I had to make the switch a parallel process and then use ID 1 in the syntax as the block and ID 2 as the switch on both x and y respectivly. It works, no demo needed. Thank you so much!


Sorry, one more thing. After it successfully presses the switch, is there any way you can make it sit on the switch after leaving the map and coming back to it and it still sits there unless you move it again?

The Niche

Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Sin86

Tried that and it still went back to its original spot.

stripe103

In the first event page that the switch tile event use, you need it to check if you have already been there(using a switch which is set to true when you go out through the door that opens when you push the switch event) and then have it move the block to the switch events position.