Scripts / Hmmm... what to say?

Author
Message
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 12th Jun 2019 19:55
I might be over my head, or maybe GG might
be pulling the wool over my eyes-- just for today! HA!
GG is calling an error on the script where I can see no reason for it to call the
variables nill (comparing 2 nill values). They have certainly been assigned values.
Maybe it's a memory issue like I and others have confronted before?
Can you call an entity number from a script to an entity "greater"
than the scripted one? [e+1], [e+2], etc? I'm pretty sure this is possible,
and it's done inside main function, not even in init, so...?

I've already done this by both referencing a "lower" [e-1] entity, and higher [e+1]
with no problem...?

Example; wx[e+wg[e]] = g_Entity[e+wg[e]]['x']
whereas wg = 1 and higher

Do I need to throw a small script upon each "higher" entity to assign it already?
Use globals? Globals give me a headache, and actually GG never allows them for me.
I restarted GG, loaded test map again, still error.
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 12th Jun 2019 19:57
Okay, I just realized now that when I re-loaded the test map
(this isn't a complicated map-- essentially empty), then
the entity's I had placed in a row, one by one, now the [e] numbers
are all jumbled up... what's going on GG?!
Testing again on brand new map...
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th Jun 2019 20:15
Do not use explicit entity ids! The engine allocates them when it loads the map so there is no way of knowing in advance what if a particular entity will get given!

This is especially important in the final stand alone as that will almost certainly have different ids than the test game!



Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 12th Jun 2019 20:41

Okay. How else would I reference the entity placed down after the other?
I need to know their # one after the other.

I have done it this way before, and maybe I got lucky (guess so), but it
worked then. I just loaded that other map, and no issues. This problem
feels like something strange because before this, GG called an error to a
section of the script that was totally commented out, so I said-- well, I'll show
you, so I deleted that area...
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Jun 2019 00:07
Check out my latest tutorial thread, hopefully all will become clear …
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 13th Jun 2019 04:49
I read through your tutorial briefly, and that's some great information,
which I will be delving into deeper for sure. Great idea.

This certain technique I was trying, perhaps is not possible.
I will work on the original. Much thanks!
PM

Login to post a reply

Server time is: 2024-04-20 04:27:45
Your offset time is: 2024-04-20 04:27:45