Jump to content

What am I doing wrong here? (Urwigo builder)


Delta68

Recommended Posts

1 minute ago, capoaira said:

oh my explanation was bad, sorry

 

For using zones, variables, ... in lua Code you have to Set the identifier. If this is "automatic" urwigo give the zone a random name...


Yay!
Setting 'Identifier" to 'targetzone' as well fixed it!

Thanks
 

Link to comment
6 hours ago, capoaira said:

urwigo give the zone a random name

 

Wait, so you can't give zones a specific name, like "lobby" or "church"? Doesn't that get confusing? Or am I missing something? Apologies if I'm barking down the wrong river, I saw the post and had flashbacks to my old programming classes and the importance of good variable names for code documentation.

Link to comment

The Name is the displayed Name. You can use the spaces or special chars. The identifier is for programming so you cannot use chars like a space.

If you don't give an identifier, URWIGO has to use an random identifier for the source code.

Edited by capoaira
Link to comment
On 6/23/2021 at 9:17 PM, Unit473L said:

 

Wait, so you can't give zones a specific name, like "lobby" or "church"? Doesn't that get confusing? Or am I missing something? Apologies if I'm barking down the wrong river, I saw the post and had flashbacks to my old programming classes and the importance of good variable names for code documentation.

I suspect it's to make it harder for the code to be read if it is decompiled. :)
 

Link to comment
On 6/25/2021 at 2:20 AM, Delta68 said:

I suspect it's to make it harder for the code to be read if it is decompiled. :)

I believe that is the case.  A little deterrent is fine.  After all, no one can prevent the easiest method of circumvention: word of mouth sharing of the final location.  So, instead, I advocate for making cartridges an enjoyable, not overlong experience, so people who do skip the cartridge are only depriving themselves of the best part.

Link to comment

A neater way of doing it is:

 

add a value to your function and use that as your object -

 

function test(val)
   return val.Name
end
 
your lua user expression then should be -
 
test (self)
 
That way you do not need to name the object, and the code is then reusable across all objects.
 
This is K1CKAHA posting on my old family account
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...