if (sprite_index changes)
{
do this
}
Check Sprite Change
#1
Posted 22 December 2011 - 12:56 AM
#2
Posted 22 December 2011 - 01:04 AM
{
}
#3
Posted 22 December 2011 - 01:14 AM
if sprite_index= "new sprite"
{
}
is that the only way to do it?
#4
Posted 22 December 2011 - 01:32 AM
Create:
spritecheck=sprite_index
Step:
if sprite_index != spritecheck
{
}
Edited by stopit540, 22 December 2011 - 01:40 AM.
#5
Posted 22 December 2011 - 01:50 AM
well you could set a variable to the sprite or its image index and check it to see if it changes something like this;
Create:
spritecheck=sprite_index
Step:
if sprite_index != spritecheck
{
}
That only worked for one sprite change though.. I need it to work for more than one.
Edit: In Step: I need it so that if the sprite changes to spr_playerwitharmour , it calls alarm[2] with variable go = 1 so that its called ONCE. BUT, I need it so if its changed back to spr_player, it calls alarm[2] with variable go = 1 so that its called ONCE. And so on..
if go = 1{
go = 0
alarm[2] = 270 // sets an alarm to make the sprite change
}
if sprite_index = spr_player // if the spriteindex is spr player
{
go = 1 // Send it to the server
} else // else
if sprite_index = spr_playerwitharmour// if the sprite index is spr_playerwitharmour
{
go = 1 //Send it to the server..
}The problem I have with the code above is that its constantly setting go = 1 therefore causing the alarm to keep happening instead of just once, therefore causing lagg..
Edited by l1ttledand, 22 December 2011 - 01:59 AM.
#6
Posted 22 December 2011 - 01:55 AM
Edit: looking at your revised post you dont need to use "else" like that if the object doesn't fit the if statement it will just move on to the next one
Edited by stopit540, 22 December 2011 - 02:03 AM.
#7
Posted 22 December 2011 - 02:03 AM
Change the sprite check to the new sprite when it changes
Spoiler
Tried that, it didnt work.. I think its cause its making the spritecheck = sprite_index.. making whats in the brackets happen only once
Edit: Yeah i did that just tryin to figure this out.. i just took it out thoughEdit: looking at your revised post you dont need to use "else" like that if the object doesn't fit the if statement it will just move on to the next one
Edited by l1ttledand, 22 December 2011 - 02:06 AM.
#8
Posted 22 December 2011 - 02:08 AM
#9
Posted 22 December 2011 - 02:28 AM
isn't that what you want it to do set "go" to one activating your alarm
yeah.. idk why its not registering.. even if the sprite_check isnt equal to the sprite_index, it doesnt set go = 1.. I mean it does, but only once, then if sprite_check equals a different number it wont set go = 1... ill keep looking, it might be a problem elsewhere, ill let you know.
#10
Posted 22 December 2011 - 03:01 AM
Edited by stopit540, 22 December 2011 - 03:04 AM.
#11
Posted 22 December 2011 - 03:10 AM
#12
Posted 22 December 2011 - 03:27 AM
#13
Posted 22 December 2011 - 05:37 AM
#14
Posted 22 December 2011 - 06:18 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











