ID:160513
 
The 4.0 Dream maker when editing an icon in a .dmi file, there is an option for "loop: # time(s)"

well anyways the loop # of times options isn't working right for me. only one time.

What it's supposed to happen is when a usr enteres the grass, the user goes into the grass itself, there is the grass icon, the grassentered and there is the leaves from the grass being rusled into the air.

Here is what i have
turf
battlegrass
name=""
btlgrass
icon='turf1.dmi';icon_state="btlgrass";density=0 //main grass image
Entered() //enter the grass
src.overlays+=/turf/battlegrass/btlgrassenter // small lil overlay appears over the user to show they are standing inside the grass
src.overlays+=/turf/battlegrass/btlgrassleaves // grass shreads get thrown in the air. which overlayes over it all and is supposed to be loop 1 time then it vanishes
Exited() // removes the overlays when exiting the grass
src.overlays-=/turf/battlegrass/btlgrassenter
src.overlays-=/turf/battlegrass/btlgrassleaves
btlgrassenter
icon='turf1.dmi';icon_state="btlgrassover";density=0;layer = MOB_LAYER+10
btlgrassleaves
icon='turf1.dmi';icon_state="btlgrassleaves";density=0;layer = MOB_LAYER+11


anyway the grass shreads being thrown in the air which has 3 frames doesn't loop 1 time through all the frames, but instead it shows the frame #1 and that doesn't go away...

I've tried using the flick() proc for the "btlgrassleaves" but when i put that in the entered() proc, that casue the double proc error.
Turfs/areas = static; they can never be moved or placed in a list like overlays or client.screen. Use objects instead.

Also, your sacrificing some readability on that code with your use of semicolons. Unless your a C++ programmer and that doesn't bother you, you might want to consider using separate lines for vars.
In response to Jeff8500
Jeff8500 wrote:
Turfs/areas = static; they can never be moved or placed in a list like overlays or client.screen. Use objects instead.

Also, your sacrificing some readability on that code with your use of semicolons. Unless your a C++ programmer and that doesn't bother you, you might want to consider using separate lines for vars.

Well i've tried putting it as obj instead of turf, but the src.overlays down's show up for me with that when using the entered() proc...

as for the semicolons, thoes are to make it where the info isn't cluttered, so i don't have to scroll down through a large list of info. It makes the code look cleaner that way.
In response to ElderKain
Oh, I just noticed you set the icon to only repeat once. That's unnecessary, you just have to time when you remove it from the overlays.

atom/proc/TEMP_OV(obj/O,delay = 10)
overlays += O
sleep(delay)
overlays -= O


If the timing isn't good, try replacing sleep() with spawn(). spawn() goes by ticks (like icons) whereas sleep() goes by 1/10 seconds (not ticks, contrary to popular belief).
In response to Jeff8500
Jeff8500 wrote:
Oh, I just noticed you set the icon to only repeat once. That's unnecessary, you just have to time when you remove it from the overlays.

atom/proc/TEMP_OV(obj/O,delay = 10)
overlays += O
sleep(delay)
overlays -= O

If the timing isn't good, try replacing sleep() with spawn(). spawn() goes by ticks (like icons) whereas sleep() goes by 1/10 seconds (not ticks, contrary to popular belief).
I have no clue what u mean by that, code, and I can't get it to overlay on entered() that way becasue it would be a proc in a proc which isn't allowed.

Pretty much it's suppose to be where when a user steps in the grass, there is a small overlay that appears over the use icon, but it's an overlay over the grass itself which happens to be over the usr. at the same time an overlay opens on top of that also to show like leaves rusling.
An example of this sort of situation would be like in the Pokemon Ruby/Sapphire where it does that when you step into grassy areas.

Also i've tried using the sleep() in it, but that doesn't start at the first frame, instead that just starts at a random position of the icon's animation frames.

In fact I can't get anything to work in the entered() proc when it;s in an object
obj
battlegrass
name=""
btlgrass
icon='turf1.dmi';icon_state="btlgrass";density=0
Entered()
world << "Test"

isn't even working, so i can't get it to do anything that way.
It's only doing something when it's turf and not obj



In response to ElderKain
atom/Entered() is called when an object (note that object != /obj) enters the atom's content.

For /area and /turf, this is done simply by walking on top of the said atom (as done per Move() I believe).

HOWEVER, for /obj and /mob, walking on top of them doesn't enter them to those two atom's content.
In response to GhostAnime
GhostAnime wrote:
atom/Entered() is called when an object (note that object != /obj) enters the atom's content.

For /area and /turf, this is done simply by walking on top of the said atom (as done per Move() I believe).

HOWEVER, for /obj and /mob, walking on top of them doesn't enter them to those two atom's content.

can u explain that in noobish, lol.
I use to code very well 3 years ago. but i've been away for quite awhile, and i've forgotten, lol
In response to ElderKain
To enter a turf/area, you stand on it. To enter an obj/mob, you have to be in it, too, but it works differently.


Just make battlegrass a turf.
In response to Jeff8500
Jeff8500 wrote:
To enter a turf/area, you stand on it. To enter an obj/mob, you have to be in it, too, but it works differently.


Just make battlegrass a turf.

Yea, I desided to make it just a turf with this for the code
turf
battlegrass
name=""
btlgrass
icon='turf1.dmi';icon_state="btlgrass";density=0
Entered()
src.overlays+=/turf/battlegrass/btlgrassenter
src.overlays+=/turf/battlegrass/btlgrassleaves
sleep(10)
src.overlays-=/turf/battlegrass/btlgrassleaves
Exited()
src.overlays-=/turf/battlegrass/btlgrassenter
src.overlays-=/turf/battlegrass/btlgrassleaves
btlgrassenter
icon='turf1.dmi';icon_state="btlgrassover";density=0;layer = MOB_LAYER+10
btlgrassleaves
icon='turf1.dmi';icon_state="btlgrassleaves";density=0;layer = MOB_LAYER+11


I used sleep(10) there after i changed the "btlgrassleaves" to have 4 frames with delay of 2, and they popup alright but still they don't start at the begining of the icon's frame which i wanted them to, oh well, what i have works just fine.

Thanks anyways all for ur help on this matter.

What i'm doing , is i'm making an exact clone of the Pokemon Ruby world, and it's for the grass areas where you enter for battle.
In response to ElderKain
Make sure the grass animation is 10 ticks long.
These are two very different effects you're trying merge. The over grass should be handled by an area, and overlay the mob or obj that enters or exits it. This way the overlay stays on the mob while they're in the grass, no matter if the move from one turf to another or stand still. The grass will always be covering them. Otherwise, the way you're doing it, the overlay will cover the mob as the walk under it, and disappear between turfs. Using an area will solve that.

Also, you could make the animation play indefinitely, and then just remove the overlay after a certain time, or if they leave the turf. The following worked for me in a small test environment: (also made your code easier for me to read :P)

world
turf = /turf/battlegrass/btlgrass

mob
icon = 'mob.dmi'

turf
battlegrass
name = ""

btlgrass //main grass image
icon = 'turf1.dmi'
icon_state = "btlgrass"
density = 0

New()
var/area/battlegrass/BGA = new()
BGA.contents += src

Entered(atom/A) //enter the grass
if(ismob(A) || isobj(A))
sleep(4)
src.overlays+=/turf/battlegrass/btlgrassleaves
spawn(3) src.overlays-=/turf/battlegrass/btlgrassleaves

Exited(atom/A) // removes the overlays when exiting the grass
if(ismob(A) || isobj(A))
src.overlays-=/turf/battlegrass/btlgrassleaves

btlgrassenter
icon = 'turf1.dmi'
icon_state = "btlgrassover"
density = 0
layer = MOB_LAYER+10

btlgrassleaves
icon = 'turf1.dmi'
icon_state = "btlgrassleaves"
density = 0
layer = MOB_LAYER+11

area
battlegrass
Entered(atom/A) //enter the grass
if(ismob(A) || isobj(A))
A.overlays+=/turf/battlegrass/btlgrassenter

Exited(atom/A) // removes the overlays when exiting the grass
if(ismob(A) || isobj(A))
A.overlays-=/turf/battlegrass/btlgrassent
In response to Xooxer
Xooxer wrote:
These are two very different effects you're trying merge. The over grass should be handled by an area, and overlay the mob or obj that enters or exits it. This way the overlay stays on the mob while they're in the grass, no matter if the move from one turf to another or stand still. The grass will always be covering them. Otherwise, the way you're doing it, the overlay will cover the mob as the walk under it, and disappear between turfs. Using an area will solve that.

Also, you could make the animation play indefinitely, and then just remove the overlay after a certain time, or if they leave the turf. The following worked for me in a small test environment: (also made your code easier for me to read :P)

world
> turf = /turf/battlegrass/btlgrass
>
> mob
> icon = 'mob.dmi'
>
> turf
> battlegrass
> name = ""
>
> btlgrass //main grass image
> icon = 'turf1.dmi'
> icon_state = "btlgrass"
> density = 0
>
> New()
> var/area/battlegrass/BGA = new()
> BGA.contents += src
>
> Entered(atom/A) //enter the grass
> if(ismob(A) || isobj(A))
> sleep(4)
> src.overlays+=/turf/battlegrass/btlgrassleaves
> spawn(3) src.overlays-=/turf/battlegrass/btlgrassleaves
>
> Exited(atom/A) // removes the overlays when exiting the grass
> if(ismob(A) || isobj(A))
> src.overlays-=/turf/battlegrass/btlgrassleaves
>
> btlgrassenter
> icon = 'turf1.dmi'
> icon_state = "btlgrassover"
> density = 0
> layer = MOB_LAYER+10
>
> btlgrassleaves
> icon = 'turf1.dmi'
> icon_state = "btlgrassleaves"
> density = 0
> layer = MOB_LAYER+11
>
> area
> battlegrass
> Entered(atom/A) //enter the grass
> if(ismob(A) || isobj(A))
> A.overlays+=/turf/battlegrass/btlgrassenter
>
> Exited(atom/A) // removes the overlays when exiting the grass
> if(ismob(A) || isobj(A))
> A.overlays-=/turf/battlegrass/btlgrassent
>






The problem with that, is I already have an area used for that location. I'm trying to make an exact copy of the Pokemon Ruby/Sapphire world map, and i have the areas for the Routes & towns set up when you enter the area there is a 7x2 sized hud image which tells the map location when you enter it, so the use of area in this matter is out of the question, lol.
Well i've already solved this problem earlier, but thanks for the feedback, I may use something similar in another game i'm making and that code may help ^.^