Hi there, i'm wondering if it is possible to change multiple icon states at once? I'm trying to do a door code and have it open when you Enter(), i've got it working per icon but the door is quite big.
Is there a way to have it so that when I enter it triggers three different things to change icon_state? so that it appears that the whole door is opening?
ID:155378
![]() Jul 20 2011, 7:53 am
|
|
![]() Jul 20 2011, 7:56 am
|
|
You want like a movie icon_state?
|
Errr... best way I think to explain it is like this:
Character enters here | V -------- | 1 | 2 | 3 | -------- | 4 | 5 | 6 | -------- I want when the character enters 2, all of the other 6 icon_states change |
Still quite simple. It requires only a get_step() proc with icon_state change.
EDIT: Here's a draft. turf |
I can't seem to get this to work :(... nothing happens.
turf |
Sorry yes, i've tried that... it didn't seem to do anything.
I need the turf tile the usr walks on to change state from say dcdoor1 to dcdoor2, and then all the tiles around it to change state also to something else. dcdoor# = closed ddoor# = open Example of a 32x32 tile layout: dcdoor4 - dcdoor5 - dcdoor6 dcdoor3 - dcdoor1 - dcdoor2 User Enters 'dcdoor1', dcdoor1 then changes state to ddoor1. This also triggers all of the other turf tiles around it to change state. So they change to this state after the user walks into dcdoor1. ddoor4 - ddoor5 - ddoor6 ddoor3 - ddoor1 - ddoor2 Thanks so much for your help so far and you patience |
Only if you're saying these doors have different icon states. I tested it myself and mine worked perfectly. Every door had a different icon but the same states, open and closed. I changed the icon state when I entered one door and the others followed suit. I don't really know why yours won't work, but it's probably because you didn't understand something.
|
I must be missing something, sorry, I am still learning so thank you for your patience with me. The turf icons I am using are all in the same .dmi icon file called 'Daedalus'.
Here is the code I have at the moment turf This is what I have when the door is closed: ![]() Thank you again for your help :). |
turf Alright. This is the easiest way in my opinion to go about doing this. Make each door in a seperate dmi. and name all the icon states the same for the 4 states. Closed Open SwingShut SwingOpen. The rest has been explained in Lugia's post. Only thing I did was make it easier to handle the icons. Using them all in the same Dmi, you have different icon states. So when trying to set them all at once wasn't working out. Which you can make it work I just figured this way is a hair easier. |
Wow thanks so much for your help, that seems to work except it doesn't like the Check proc:
Daedalus.dm:25:error: var/mob/a: undefined var Daedalus.dm:30:error: Check: undefined proc Daedalus.dm:23:error: src.Check: undefined proc Daedalus.dm:24:error: Check: undefined proc If I get rid of that it works, except for a few little things: A. It doesn't change the state of the turf I enter B. It doesn't change the door back to the "closed" state after a few seconds. C. It changes the state of all the other doors turfs really slowly. I had to delete the sleep(5) for it to change them all instantly. I don't have a "swing" state, the doors just go from "Closed" to "Open" so don't worry about factoring that it Thanks for everyones help on this so far :), you're all legends, nearly there :) |
Try changing oview to view. oview doesn't include the center. and if you deleted the Check proc, after it's icon state is changed to Open, add a sleep for how long you want it to stay open, and than T.icon_state="closed". That should fix those problems.
|
O wow thanks that works a treat! this has been bugging me for days and thanks to you guys you've helped me solve the issue :), thank you so much!
|