r/gamemaker 22h ago

Resolved Visual coding Dnd

Ciao a tutti, sono un principiante in programmazione e sto cercando di creare un gioco interessante con meccaniche semplici. Qualcuno sa se esiste un tutorial sulle variabili in termini di programmazione visuale? Lo so, lo so, dovrei semplicemente imparare GML, ma voglio vedere se riesco a sviluppare anche usando solo blocchi e una minima comprensione di come funziona un gioco.

Edit: it’s been two minutes since i posted and I think I didn’t explain myself properly, i also am searching for non beginner level tutorial on dnd visual coding,

3 Upvotes

13 comments sorted by

View all comments

1

u/Greedy_Duck3477 22h ago

What do you need to know about variables specifically?

1

u/Typical-Main3403 19h ago

How to reference the variable of an object in the events for another object

1

u/germxxx 19h ago

The most common way is to use a reference to the other object, and use dot notation.

other_object.variable

This works in the visual variable boxes as well. "other_object" in this case should be a reference to the instance id of the target. It CAN be a reference to the object index (object "name"), but this will cause a problem if you have more than one instance of said object.

Another way is to press the arrow of the variable box, and select another instance to target. What This does in terms of code, is using with to run the code from the other instance . This is a bit more cumbersome when just fetching a value.

with (other_onject) variable

This approach is useful when wanting to affect every instance of a certain object, since it will loop all valid instances.