• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Undeclared Variables in UHPS

Status
Not open for further replies.
Level 30
Joined
Jan 31, 2010
Messages
3,551
Posted this a while ago in the original spell thread - but to no response from anyone subbed to the thread, which is a shame. Instead of writing everything over again, here's the post's link: http://www.hiveworkshop.com/forums/2664810-post77.html

What am I doing wrong?

edit: "bonus", no matter how I place a doodad, it will always have 1 for that value. How does one get it to, let's say, 1300, like Kobas did?
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
You need to copy all required pre-placed objects in the terrain editor. However, I'm not sure this single step will fix the whole issue. Those objects will generate variables when placed in the terrain editor, such as gg_dest_B00D_1. It means the variable refers to a destructable with rawcode 'B00D' with first index (may be he placed it at the early time of map creation), or maybe I'm wrong about this index thingy. So you should have exactly correct rawcode for every destructable in the object editor and should have exactly the same placement order because it determines the index. Or you need to rearrange the trigger somewhere, maybe in the configuration or constructor function.

This is why a system which requires pre-placed objects shouldn't be used, and approved. In GUI, this error can be tolerated quite easily, but sadly, it's in vJass. Maybe you can ask a coder to modify the system so it can build the interface using trigger.
 
Last edited:
Level 20
Joined
Jul 6, 2009
Messages
1,885
This is why a system which requires pre-placed objects shouldn't be used, and approved.

This pretty much.

Anyway, I'm not certain that simply placing the objects will generate corresponding variables (I could be wrong, I haven't modded in a while), but if it's not the case, you can always make a simple GUI trigger that will refer to your objects (such as destroying them) and then convert it to JASS to get the variable names of each object and make sure they're generated. You'd delete the said trigger afterwards, of course.
 
The number you marked there is not the correct number (index).
Select the tree or what ever and look at it's information at bottom of editor:

Selection: Name XXXX
Variation: X

The XXXX is somehow an index number you have to use the destructable:
gg_dest_'rawcode'_XXXX

I'm not certain that simply placing the objects will generate corresponding variables
Yes, it does not. It does not exist until you select it.
 
Level 30
Joined
Jan 31, 2010
Messages
3,551
I doubt Kobas would remake the entire system just to make it fit my project. Really doubt it.

And I did copy all the destructibles, and even tried placing multiple of those in order to get the number going higher, but it stayed on each of them at 1.

It's neat to know these things, but I still don't know how to make the system actually work. Pardon my lack of jass knowledge.

edit: hold on, trying Garf's method, seems that it could work out
 
Level 30
Joined
Jan 31, 2010
Messages
3,551
Double posting for the sake of the important update: following Garf's advice, I've managed to pull this out. Apparently, when you select the doodad with any GUI trigger, it will give the number you need. Many thanks for that :)

I however have to say that I regret deciding to use this system. Since EVERYTHING was X Y based, and I really couldn't waste a full day just to make everything in place, I had to place the whole set-up in the middle of the map rather than somewhere in the corner. It also offered awfully little flexibility, but I've been a little creative to surpass that. I guess I'll be requesting a whole new system for later updates, but that's for a different thread; here's how it looks now thanks to you guys :)

~Solved.
 

Attachments

  • RangerPrev.JPG
    RangerPrev.JPG
    80.2 KB · Views: 52
  • RosePrev.JPG
    RosePrev.JPG
    76.9 KB · Views: 46
Status
Not open for further replies.
Top