ID:160485
 
Ok I have a game with Milti-Tiled Characters.
Hey are set like this

Head
Body

I can use the flick("Icon_state",usr) to click the base icon, but how do i get it where I can flick the Head's icon_state at the same time as the main body's icon_state flicks.

Edit: I 'm not sure but i think it has something to do with like
Flick icon_state in usr.overlays but I don't know how to get it where it would single out the
usr.overlays+=/obj/boyhead
without changing any of the other overlay.

sry I'm not that good at coding

Edit: Problem to this is solved, refer to id=661879 for the solution to the problem I had
Overlays can not be flicked.
In response to Andre-g1
Andre-g1 wrote:
Overlays can not be flicked.

...
Then how can I go about getting an my multi-tiled characters to be able to have a head and body spot to be able to both flick? becasue they both have to be timed exactly from the start of the icon_state they are suposed to change into temporaraly, and if i just change the icon_state without flicking, it could start in the middle of the animation sequence which would throw the whole thing off...
In response to ElderKain
Could you not add the overlay sleep then remove it would this not produce the same effect as a flick?

Or can't overlays have movement states?
In response to ElderKain
I'm not sure, but I think Images can be flicked.
In response to A.T.H.K
A.T.H.K wrote:
Could you not add the overlay sleep then remove it would this not produce the same effect as a flick?

Or can't overlays have movement states?

just changing icon_states with sleep proc, doesn't work right becasue i'm needing it where the changed icon_state starts at the begining of the animation. If i use sleep, it doesn't always start at the begining of the animation but can start in the middle of it.

Overlays can have movement states or there woudn't be any moveable coutfit/equipment overlays in the games already out there, lol
In response to ElderKain
ElderKain wrote:
Overlays can have movement states or there woudn't be any moveable coutfit/equipment overlays in the games already out there, lol

I know that ... as in movies though anyway why not use overlays to "flick" if you can't use the flick proc.
In response to A.T.H.K
A.T.H.K wrote:
ElderKain wrote:
Overlays can have movement states or there woudn't be any moveable coutfit/equipment overlays in the games already out there, lol

I know that ... as in movies though anyway why not use overlays to "flick" if you can't use the flick proc.

What i'm making is an exact copy of "Pokémon Ruby" and the character icon height is higher than 32 pixels so there has to be a top & bottom icon for it I've got the icon animation states done for it, but in the game there are jump ledges and when you do that, there is a jumping animation which I have got that for the jumping of the edge. I have it set to where when the character bumps into the lege facing South, it flicks the main bottom icon, but what i'm wanting is to be able at the same time be able to flick the top icon_state to where it can show the full jumping effect.

This is for an example of what i mean

Note: I'm not gonna give all the code, so I just selected part that's used in what i'm trying to do.
world/mob=/mob/pc

atom/proc/jumpblock()

mob/pc
Login()
usr.icon='boy.dmi'
usr.icon_state="bottom"
usr.overlays+=/obj/boyhead
usr.loc=locate(3,3,1)
world << "<b>[usr]</b> Has connected."
Bump(atom/jump)
jump.jumpblock()

obj/boyhead
icon = 'boy.dmi'
icon_state="top"
layer=MOB_LAYER+3
pixel_y=32

turf
outside/jumpedge
name=""
jumpedge02
icon='turf1.dmi';icon_state="jumpedge02";density=1
jumpblock()
if(usr.dir==SOUTH)
flick("bottomjump",usr)


I want it to be able to flick the top icon also that way the bottom and top's icon_stat will match up.
In response to ElderKain
Sry for the double bost but in a lil over 2 hours and it will have been 24hours, and this post was on page3 so it was out of view, lol.

I'm still needing help.
Refer to my last post for more info on what i'm mainly after.
In response to ElderKain
I'm not a great coder or anything but I think I know what you are trying to get firstly. How did you add the top overlay do you have it set something like this?

obj
boytop
icon='boy.dmi'
icon_state="top"


If so you can't officially "flick" the icon state but you should be able to do something like this. Btw the sleep numbers is just random.

obj
boytop2
icon='boy.dmi'
icon_state="jump"
turf
outside/jumpedge
name=""
jumpedge02
icon='turf1.dmi';icon_state="jumpedge02";density=1
jumpblock()
if(usr.dir==SOUTH)
usr.overlays-=/obj/boyhead
usr.overlays+=/obj/boytop2
flick("bottomjump",usr)
sleep(20)
usr.overlays-=/obj/boytop2
usr.overlays+=/obj/boyhead

Not positive that will work since I don't have the necessary icons to really test it out.
In response to THESINKING
THESINKING wrote:
I'm not a great coder or anything but I think I know what you are trying to get firstly. How did you add the top overlay do you have it set something like this?

> obj
> boytop
> icon='boy.dmi'
> icon_state="top"
>

If so you can't officially "flick" the icon state but you should be able to do something like this. Btw the sleep numbers is just random.

> obj
> boytop2
> icon='boy.dmi'
> icon_state="jump"
> turf
> outside/jumpedge
> name=""
> jumpedge02
> icon='turf1.dmi';icon_state="jumpedge02";density=1
> jumpblock()
> if(usr.dir==SOUTH)
> usr.overlays-=/obj/boyhead
> usr.overlays+=/obj/boytop2
> flick("bottomjump",usr)
> sleep(20)
> usr.overlays-=/obj/boytop2
> usr.overlays+=/obj/boyhead
>

Not positive that will work since I don't have the necessary icons to really test it out.

actually, that won't work because the animation for the overlay won't start at the start of the animation
for some reason the flick() animation happens before the overlay animation, they don't start at the same time.

I'm wanting it where the top and bottom animation will match up exactly, that's why i was asking how to flick the top because if you flick, it starts at the begining of the animation rather than if you just do an overlay change it tends to start at random points of the animation sequence.
In response to ElderKain
Try putting a sleep after changing overlay but before flicking? Because from what I'm getting is that the overlay is just behind. So if you figure out how much it's behind you should be able to precisely time it to go at the same time through the sleep proc.
In response to THESINKING
THESINKING wrote:
Try putting a sleep after changing overlay but before flicking? Because from what I'm getting is that the overlay is just behind. So if you figure out how much it's behind you should be able to precisely time it to go at the same time through the sleep proc.

with it being in the same area, with that coding it goes in a strange order, so if you go
    jumpblock()
if(usr.dir==SOUTH)
src.density=0
usr.overlays-=/obj/boyhead
usr.overlays+=/obj/boyjump
flick("bottomjump",usr)
usr.loc = locate(usr.x,usr.y-1,usr.z)
sleep(5)
usr.loc = locate(usr.x,usr.y-1,usr.z)
usr.overlays-=/obj/boyjump
usr.overlays+=/obj/boyhead
src.density=1

else
..()

it tends to do the flicking before the usr.overlays+=/obj/boyjump animation starts. so they don't match up.
In response to ElderKain
Have you tried.

jumpblock()
if(usr.dir==SOUTH)
src.density=0
usr.overlays-=/obj/boyhead
usr.overlays+=/obj/boyjump
sleep(2)//Guessing on the number I'm not sure how long it takes for the overlay to take effect
flick("bottomjump",usr)
usr.loc = locate(usr.x,usr.y-1,usr.z)
sleep(5)
usr.loc = locate(usr.x,usr.y-1,usr.z)
usr.overlays-=/obj/boyjump
usr.overlays+=/obj/boyhead
src.density=1

else
..()
In response to THESINKING
THESINKING wrote:
Have you tried.

>             jumpblock()
> if(usr.dir==SOUTH)
> src.density=0
> usr.overlays-=/obj/boyhead
> usr.overlays+=/obj/boyjump
> sleep(2)//Guessing on the number I'm not sure how long it takes for the overlay to take effect
> flick("bottomjump",usr)
> usr.loc = locate(usr.x,usr.y-1,usr.z)
> sleep(5)
> usr.loc = locate(usr.x,usr.y-1,usr.z)
> usr.overlays-=/obj/boyjump
> usr.overlays+=/obj/boyhead
> src.density=1
>
> else
> ..()




That works but the Overlay's animation doesn't always start at the start of the animation.
That's why I was talking about Flicking the overlay because using the flick proc starts at the very begining of the animation. and just temporaraly changing the overlay like above, the animation doesn't always start at the start.
In response to ElderKain
Well from what I know about coding that's the only way I see it possible. And the fact that the overlay doesn't start at the beginning is rather weird. Hopefully someone else knows how to fix that.
In response to THESINKING
THESINKING wrote:
Well from what I know about coding that's the only way I see it possible. And the fact that the overlay doesn't start at the beginning is rather weird. Hopefully someone else knows how to fix that.

Icons don't always start at the exact begining animation frame, that's why there is the flick proc, becasue flick starts at the begining animation frame always.
That's why I'm needing a way to flick the overlay of the top icon in the multi-tile, becasue it just doesn't match up if the flick proc isn't used on it.
In response to ElderKain
I'm taking a gander at this without testing it out but try flicking the overlay through this.

flick("jump",/obj/boytop)

I really doubt it will work but it's worth a shot.
In response to THESINKING
THESINKING wrote:
I'm taking a gander at this without testing it out but try flicking the overlay through this.

> flick("jump",/obj/boytop)
>

I really doubt it will work but it's worth a shot.

Nope, still not working right, I think I already tried that.
Proper use of overlays should automatically flick the same state as the object it overlays. Your bottom half and top half should have separate icons with the same exact icon_states, but drawn to fit the top or bottom. When you flick the mob, it should automatically flick the overlay if the overlay has the same icon_state in it's icon. Movement works like this as well. So long as the overlay has the same icon_states, it should automatically try and match its object's states as they change.
Page: 1 2