• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spell Str based

Status
Not open for further replies.
Level 7
Joined
Aug 15, 2012
Messages
318
I have been working on my rpg and since my save/loads acting up thought id work on spells well I made this it seems to work on other maps just not mine..
Had it tested in a blank map with just peons and hero using skill worked fine in my rpg I get 3 errors...
call RemoveLocation(udg_loc) : invalid argument type (handle)
call DestroyGroup(udg_group) : invalid argument type (handle)
//=========================================================================== : expectted a code statement (handle)


  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set loc = (Position of (Triggering unit))
      • Set group = (Units within 300.00 of loc matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) is alive) Equal to True))))
      • Set RealDmg = (Real((Strength of (Triggering unit) (Include bonuses))))
      • Environment - Create a 1.00 second Normal ripple deformation at loc with starting radius 1024.00, ending radius 1024.00, and depth 64.00, using 1.00 second ripples spaced 512.00 apart
      • Environment - Create a 1.00 second wave deformation from loc to loc with radius 256.00, depth 96.00, and a 0.03 second trailing delay
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (100.00 + RealDmg) damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call DestroyGroup(udg_group)
So no one can or wants to help?
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
It should really work. I copy/pasted the exact same lines and it worked without any problems.
Maybe check the type of the variables again (should be "Point" and "Unit Group"), but then the error would be in setting the variables as well, which isn't the case.
Edit: also, the third error doesn't really mean anything, though it might indicate that the problem isn't with the custom scripts, but something that happens before those.

Upload the map.
 
Level 7
Joined
Aug 15, 2012
Messages
318
Level 28
Joined
Jan 26, 2007
Messages
4,789
That spell doesn't give any error and works just fine. It's probably your editor acting up.
You shouldn't use Thunder Clap/War Stomp as a base spell, but that's only because of the terrain deformation (doesn't really change anything).

About the save/load-system: it took me a while to realize, but some variables haven't been copied over correctly.
This is a fault of the editor: if a variable is only used in arrays/loops, then it will be copied, but won't have a type.
The variables are "Integer_A" and "Integer_B". Fixing it will cause a lot of problems at first :p.

Before you go any further with your map, here's a list of things you should know:
  • Things that Leaks (you show hints that you kinda know it, but not really).
  • Organize your objects! The "Melee" objects should not be changed. All heroes should belong to the same race, all neutrals to another and all enemies to yet another race.
    Same for spells, items and so on.
  • Loops (see below).

In "Melee Initialization", all the ITE's can be combined to this:
  • Set TempLoc1 = (Center of Spawn 1 <gen>)
  • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 The Decision for (Player((Integer A))) at TempLoc1 facing Default building facing degrees
          • Player - Add 1 to (Player((Integer A))) Available free Heroes
        • Else - Actions
  • Custom script: call RemoveLocation(udg_TempLoc1)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
No, I think the best solution is to create 2 new variables ("LoopInt1" and "LoopInt2", integers) and replace every instance of "Integer_A" with "LoopInt1" and every instance of "Integer_B" with "LoopInt2".
When that is done, you can remove the variables "Integer_A" and "Integer_B".

Also, I don't think you've set the player hero-variable to any value. It's the variable that saves the hero, so it's quite important.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I do have Skype (and used to have Teamviewer), but that's private.
I did change the map a little for you.


Having 999 levels for an ability is absolutely horrible: don't ever do that again.
It increased my loading time by 30% (999 levels: 8 seconds, 640 milliseconds / 4 levels: 6 seconds, 630 milliseconds).
It also creates a massive lagspike whenever a hero is created.
There are better ways to do this. I've imported BonusMod and created a little system around it. Now it uses 16 abilities with 1 level (including "Attribute Bonus") to give -16384 - +16383 stats.
This value is also saved/loaded (2 reasons: first of all because the skill points would otherwise bug, second because spam-clicking the attribute bonus is annoying).

Save/load code works properly now (saves: class, exp, gold, lumber, attribute bonus, str, agi, int).
Note: I've compressed gold and experience with a lossy compression. This means that the saved values are slightly different from the real ones.
(Example: real value = 11336 experience, saved value = 11348 experience). This is to make the code slightly shorter (you can undo this if you want).

Other minor changes: some memory leak fixes, small improvements in efficiency and fixed the icons.
 

Attachments

  • Our RPG v0.24 (edit).w3x
    1.9 MB · Views: 27
Status
Not open for further replies.
Top