• 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.

[Trigger] Sell-Help

Status
Not open for further replies.
Level 8
Joined
Aug 1, 2008
Messages
420
Hi guys, i am a total froob at mapmaking, but im learning steadily. This is my first map, so where better to start then a TD.. I made a sell trigger for my map,:
  • Sell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sell
    • Actions
      • Special Effect - Create a special effect at (Position of (Casting unit)) using war3mapImported\StarfallCaster.mdx
      • Unit - Pause (Casting unit)
      • Wait 2.50 seconds
      • Player - Add (Point-value of (Casting unit)) to (Owner of (Casting unit)) Current gold
      • Unit - Kill (Casting unit)
      • Special Effect - Destroy (Last created special effect)
Now i went to test it, and found that i cant sell 2 buildings at once, (It creates the effect, pauses the building, then just leaves it standing there still with the effect on)which presumebly means its not MUI? I really dont know how to fix that, but i think if i remove the special effect it would work, but i dont want to if possible.
Can anybody tell me whats wrong? +rep to all that help.
Thanks
 
Level 8
Joined
Aug 1, 2008
Messages
420
But then removing the wait destroys the special effect immediately - any other way how i could do it?
 

kj_

kj_

Level 5
Joined
Aug 1, 2008
Messages
134
  • Sell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sell
    • Actions
      • Unit - Pause (Casting unit)
      • Player - Add (Point-value of (Casting unit)) to (Owner of (Casting unit)) Current gold
      • Unit - Kill (Casting unit)
        • Special Effect - Create a special effect at (Position of (Casting unit)) using war3mapImported\StarfallCaster.mdx
        • Wait 2.50 seconds
        • Special Effect - Destroy (Last created special effect)
Try this , haven't tested it yet but check quick
 
Level 8
Joined
Aug 1, 2008
Messages
420
No - that doesnt work either. It destroys both the towers, but leaves one of the special effects there
 
Level 5
Joined
Nov 14, 2007
Messages
161
couldn't he just add custom text lines that makes some local variables? one for the building (unit) and one for the effect (effect)? or use JASS.

  • The Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sell
    • Actions
      • Custom script: local effect e
      • Custom script: local unit shop
      • Set shop = (Triggering unit)
      • Special Effect - Create a special effect at (Position of shop) using war3mapImported\StarfallCaster.mdx
      • Player - Add (Point-value of shop) to (Owner of shop) Current gold
      • Set e = (Last created special effect)
      • Unit - Pause shop
      • Wait 2.50 seconds
      • Unit - Kill shop
      • Special Effect - Destroy e
or the JASS version which i would make a backup and disable what you have. copy it. and go to EDIT > Convert to custom text. then replace what's there with:

JASS:
function Trig_Sell_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A001'
endfunction

function Trig_Sell_Actions takes nothing returns nothing
    local effect e
    local unit shop = GetTriggerUnit()
    set e = AddSpecialEffectLoc( "war3mapImported\\StarfallCaster.mdx" , GetUnitLoc( shop ))
    call PauseUnit(shop, true)
    call TriggerSleepAction( 2.50 )
    call AdjustPlayerStateBJ( GetUnitPointValue(shop), GetOwningPlayer(shop), PLAYER_STATE_RESOURCE_GOLD )
    call KillUnit( shop )
    call DestroyEffect( e )
    set e = null
    set shop = null    
endfunction

//===========================================================================
function InitTrig_Sell takes nothing returns nothing
    set gg_trg_Sell = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Sell, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Sell, Condition( function Trig_Sell_Conditions ) )
    call TriggerAddAction( gg_trg_Sell, function Trig_Sell_Actions )
endfunction

im not always perfect with JASS but i think i did the best i could, just change the "GetSpellAbilityId() == 'A001'" part to the skill id of your sell. (to get that push CTRL + D in object editor when u look at it) Note: the triggers name i used was Sell, but that shouldnt matter.

AHHH, forgot to add unit point value / money to it... EDITED

ok, i tested it, the jass one works just fine. just remember to change the skill id >.<
 
Last edited:
Level 4
Joined
Aug 7, 2008
Messages
115
I got a better idea...Give your unit(builder) the ability of Unsummon Building of Undead Acolyte(And modify it as you wish) after that create a trigger with:

Event:
Unit - a unit casts an ability
Condition:
(Ability being cast) equal to Unsummon Building
Action:
Special effect - create the epecial effect on (casting unit) at point: Origin of thunderClap.Mdl
Wait 1.00seconds
Special effect - Destroy(last created special effect)

*-->I dont know how is the Special effect trigger correctly so read it and there will be something similar.

I hope it works! Cya
 
Level 8
Joined
Aug 1, 2008
Messages
420
Triggering unit doesnt work either, im just about to try the JASS trigger.
EDIT: With the JASS trigger i get 17 compile errors, lol.
Ive attached the errors in a picture along with the trigger.
(You'll have to "expand to acutal size" or it will be bad quality.
 

Attachments

  • error.jpg
    error.jpg
    165.4 KB · Views: 101
  • error2.jpg
    error2.jpg
    180.7 KB · Views: 98
Level 5
Joined
Nov 14, 2007
Messages
161
Triggering unit doesnt work either, im just about to try the JASS trigger.
EDIT: With the JASS trigger i get 17 compile errors, lol.
Ive attached the errors in a picture along with the trigger.
(You'll have to "expand to acutal size" or it will be bad quality.

on the pic on the left, the copy messed up so that the condition statement doesnt say the same thing:
yours:
JASS:
function Trig_Sell_Cfunction Trig_Sell_Conditions takes nothing returns boolean
and mine:
JASS:
function Trig_Sell_Conditions takes nothing returns boolean

as for the pick on the right, i think because the condition isnt correct, it isnt actually finding a triggering unit. fixing the condition should fix the whole thing, if not i honestly dont know why it's messed up. i did make those variables also global. (cus sometimes it wont want to save) though JASS is awesome and will take the local variable first so it wont have any problems. Solution: add those same variables in GUI.

e = Special Effect
shop = Unit

good luck

edit: looking at it again im pretty sure fixing that first thing in the conditions will solve all your problems with it. if it wont save cus of variables, add them to GUI and it should work fine. cus i changed my first line to yours and got 17 errors >.>

edit2: i attached the map made the trigger(s) on. granted i probably could have used a better skill other than roar but it was the first one i grabbed lol. and i dont have the effect file so it is kinda bland but you can test out the MUI factors of the skill (hotkey is still "R")
 

Attachments

  • selling turrets.w3x
    17.5 KB · Views: 73
Level 8
Joined
Aug 1, 2008
Messages
420
As i said before - triggering unit does not work either, (if you dont believe me you could try it yourself :sad:)
EDIT: YO_MA_MA, i replaced the first line with that, and now it works excellent, thanks a bunch. +Rep
 
Last edited:
Status
Not open for further replies.
Top