Custom Script Error ... Any help?

Jolly chap*

New Member
Reaction score
34
Hi! :)

I've made a trigger and I've got a location variable ... but its an array so I don't know how to type it in for the custom script to remove teh memory leak.

Code:
Spirit Trans
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Spirit Transportation 
    Actions
        Set Spirit_Transportation_Loc[(Player number of (Owner of (Triggering unit)))] = (Position of (Target unit of ability being cast))
        bla bla bla ...

For the custom script, I'm not sure what to type in because I haven't used arrays for the variable up till now. I've tried:

Code:
Custom script:   call RemoveLocation(udg_Spirit_Transportation_Loc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]

But it won't work? Did I spell or type something wrong in the custom script or something? I know there's a simple way to solve this. I think I've seriously missed something tiny like a typo but ... :p
 

LightChaosma

New Member
Reaction score
60
Hi! :)

I've made a trigger and I've got a location variable ... but its an array so I don't know how to type it in for the custom script to remove teh memory leak.

Code:
Spirit Trans
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Spirit Transportation 
    Actions
        Set Spirit_Transportation_Loc[(Player number of (Owner of (Triggering unit)))] = (Position of (Target unit of ability being cast))
        bla bla bla ...

For the custom script, I'm not sure what to type in because I haven't used arrays for the variable up till now. I've tried:

Code:
Custom script:   call RemoveLocation(udg_Spirit_Transportation_Loc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]

But it won't work? Did I spell or type something wrong in the custom script or something? I know there's a simple way to solve this. I think I've seriously missed something tiny like a typo but ... :p


do it like this:
set tempint =
(Player number of (Owner of (Triggering unit)))
Set Spirit_Transportation_Loc[tempint] = (Position of (Target unit of ability being cast))
RemoveLocation(udg_Spirit_Transportation_Loc[udg_tempint]
 

Jolly chap*

New Member
Reaction score
34
I am trying to make it MPI and I don't need another integer variable again ... I'm pretty sure the above is enough. :(

There's something wrong with the custom script. Everytime I save my map, this trigger won't work coz of the custom script.
 

Artificial

Without Intelligence
Reaction score
326
You're just missing one ) from the very end of it, after the ].
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top