How do I slices
Moderators: marionline, SDHawk
I think I actually needed to use this command, ironically. I remembered you saying this and felt immediately like I was doing something wrong. But I only used it because I have a script in the main loop that changes the cursor based on what the mouse is hovering over, and not all of the slice collections have that slice. Every time the game opened up it would give a script error for an invalid slice handle.Bob the Hamster wrote: Also, there is almost never any good reason to use the "slice is valid" command. I need to update the docs to make it clear that command is only really there for debugging.
Code: Select all
if(slice is valid(lookup slice(sli:forward))) then(
if(slice collide point(lookup slice(sli:forward),x,y)) then(
replace weapon sprite(cursor,2))
else(
replace weapon sprite(cursor,0))
)
if(slice is valid(lookup slice(sli:backward))) then(
if(slice collide point(lookup slice(sli:backward),x,y)) then(
replace weapon sprite(cursor,3))
else(
replace weapon sprite(cursor,0))
)
Last edited by kylekrack on Sun Jun 14, 2015 10:29 pm, edited 1 time in total.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife