You are not logged in.
Pages: 1
Hi there
I've created some script during making on my game. This scripts controll the existence any instance in room dependence on some variable: it means, the instance can exist, only, if selected variable has current value. If not, the instance will be destroyed. Look at code and than understand.
//instance_variable_controll(object,x,y,variable,value)
// Create by NicharCZ
// Copyright 2011
//
//
var obj, variable, value, xx, yy;
obj=argument0
xx=argument1
yy=argument2
variable=argument3
value=argument4
if variable==value && !instance_exists(obj) {
instance_create(xx,yy,obj)
}
if variable!=value {
if (instance_exists(obj)) {
with (obj)
instance_destroy()
}
}
I'm sorry for my english, that's really tragic
Edits: Correction
Last edited by NicharCZ (2011-07-19 09:18:05)
Offline
OK, I can see what this does, but I do not understand how it should be used. How was this used for your game?
Abusing forum power since 1986.
Offline
Well, i show you some example:
I have swiching with buttons. If I click the first button, variable global.mode=1, if I click the second button, variable global.mode=2 etc.. And other object can exists only if global.mode=1.. With my script, you can select position of instance, object, variable and value itself.
Offline
Pages: 1