nearest instance,. .

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

nearest instance,. .

Post by jph_wacheski »

OK I thought I could get this to work but WOW strangeness happening,. .

see file,.

not really sure what is happening here,. with the array dimed to [9,0] sic! I get the target_indicator on the last target to spawn,. nor sure how,. and with it set the way it should be [9,2] nothing,. what? Can anyone please point out;
A. why i get that result with the array [9,0] and
B. how to do this so it actualy works?

Either I am missing something very basic (if i only had a,...),. or something is not working how I understand it should.
Attachments
targeting_instances_003.zip
what the,. . ?
(1.26 KiB) Downloaded 461 times
iterationGAMES.com
User avatar
Kjell
Posts: 1924
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi jph,

Each dimension of a Array needs a length of at least 1 for it to be able to hold any data at all ... otherwise ZGE ( should ) returns a "Array out of Bounds" error as soon as you try to read/write to it.

And I'm not quite sure why your example doesn't work, but I've attached a example of what you're trying to do. Keep in mind that you'll need a register as soon as you're going to delete Instances.

K
Attachments
Target.zgeproj
(3.03 KiB) Downloaded 502 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

nice one,. .

Post by jph_wacheski »

Cool, thanks kjell!
Thought I was trying to do something imposible for a second there,. just gald to see it working! I will go through and reconcile your method with my working style and see if I can get it to work while destroying them,. what do you mean by a "register",. just some way of knowing not to check dead ones? idealy it will be an automated system that can check a dynamic number of instances as they are birthed and destroyed,. . I'll see if I can hack that out,. thanks again bro.
iterationGAMES.com
User avatar
Kjell
Posts: 1924
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi jph,

Well, something that for instance emulates the ds_list of GM. Since when you for example spawn 8 instances, and then destroy instance 5, you're left with a open slot. Now there are a couple of approaches you can take here ( re-assigning identities, keeping track of used / un-used slots ) .. but I usually go with a Registry array that keeps track of the active instances and refers to the according slot where it's Data is stored.

K
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

humm that sounds like another good idea,. I will see if I can integrate it.
I just implemented it as 'waves' for now as I just want to build a quick and dirty game for some fun,. here is the very basic start.

ARROWS and Z,X or C (hay,. can we assign Shift and Control?? for my german freinds ;) and other with non-engrish boards )

Could be lockOn2 the successor to my very first GM release,. could do some crazzy stuff now in ZGE so it will be a fun one,. Cheers.
Attachments
lockOn2_001.zip
.exe so as not to confuzz anyone,. . my hacks get messy.
(32.92 KiB) Downloaded 501 times
iterationGAMES.com
Post Reply