• 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] Interaction Spell

Status
Not open for further replies.
Level 2
Joined
May 18, 2018
Messages
18
Hello. Id like to ask if someone can give me some good tips on making an interaction spell
example: use interaction spell somewhere, nothing happens
use it next to a bookshelf doodah, text appears, or you take an item from the shelf (item spawns on ground) etc, you know what i mean
i know in basic how it works, you make a spell that deals no dmg etc maybe displays a ! or some sort of mark depanding on where you use it, and then you make certrain regions where if the spell is used on, something happens
id just like some tips on idk like
whats the best spell to use as a base and so on. I can normally figure stuff out like this but this one is kinda overwhelming or maybe im just dumb
 
Sounds like a very broad scope of functions. Taking items from shelves would just be a "unit acquires item" event, not a spell (it's not impossible, but easier).

For an interaction spell you can use whatever as long as you remove all art and damage and so on. It would be best to make it target a unit instead of point as that gives you the broadest set of possibilities. Unless of course you make two interaction spells. The hard part isn't making the spell it's making objects and areas react correctly to your spell. Give me an example of something you want to happen then I can point you in the right direction.

Personally I would never use an interaction spell simply because I can use attack/stop or other events to trigger what I need. Separate items that can be used on different locations etc.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
You should base the spell (and most custom spells) on Channel ('Ancl'): Spells - Channel. The way you described it with regions is pretty much the easiest way to get this to work:

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to INTERACT
  • Actions
    • Set U = (Triggering Unit)
    • If (Conditions) then (Actions) else (Actions)
      • If - Conditions
        • (Book Region 1 <gen> contains U) equal to true
      • Then - Actions
        • -------- do stuff for book region 1 --------
      • Else - Actions
    • If (Conditions) then (Actions) else (Actions)
      • If - Conditions
        • (Book Region 2 <gen> contains U) equal to true
      • Then - Actions
        • -------- do stuff for book region 2 --------
      • Else - Actions
    • If (Conditions) then (Actions) else (Actions)
      • If - Conditions
        • (Book Region 3 <gen> contains U) equal to true
      • Then - Actions
        • -------- do stuff for book region 3 --------
      • Else - Actions
You could also do something like this where you set up a bunch of points beforehand and check the distance to each point:
  • Events
    • Time - Elapsed game-time is 0.10 seconds
  • Conditions
  • Actions
    • Set InteractCount = (InteractCount + 1)
    • Set InteractPoint[InteractCount] = Center of Book Region 1 <gen>
    • Set InteractDistance[InteractCount] = 150.00
    • Set InteractTrigger[InteractCount] = Do Stuff with Books 1 <gen> //these are triggers you make for each possible interact
    • Set InteractCount = (InteractCount + 1)
    • Set InteractDistance[InteractCount] = 150.00
    • Set InteractPoint[InteractCount] = Center of Book Region 2 <gen>
    • Set InteractTrigger[InteractCount] = Do Stuff with Books 1 <gen> //can re-use triggers for multiple interactions
    • Set InteractCount = (InteractCount + 1)
    • Set InteractDistance[InteractCount] = 30.00 //have to be really close to this book to get it to work
    • Set InteractPoint[InteractCount] = Center of Book Region 3 <gen>
    • Set InteractTrigger[InteractCount] = Do Stuff with Books 3 <gen>
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to INTERACT
  • Actions
    • Set InteractUnit = (Triggering Unit)
    • Set InteractPos = (Position of U)
    • For each Integer InteractCheck from 1 to InteractCount do (Actions)
      • Loop - Actions
        • If (Conditions) then (Actions) else (Actions)
          • If - Conditions
            • (Distance between P and InteractPoint[InteractCheck]) less than InteractDistance[InteractCheck]
          • Then - Actions
            • Trigger - Run InteractTrigger[InteractCount] (Checking conditions)
          • Else - Actions
    • Custom script: call RemoveLocation(udg_InteractPos)
And an example of what perhaps Do Stuff with Books 1 looks like:
  • Events
    • -------- doesn't need any, is run manually --------
  • Conditions
    • ((Interact Unit) has buff Supreme Knowledge) equal to true //only works when you have this buff
  • Actions
    • Item - Create 1 Awesome Book at InteractPos
    • Sound - Play somesound <gen>
 
Level 2
Joined
May 18, 2018
Messages
18
Sounds like a very broad scope of functions. Taking items from shelves would just be a "unit acquires item" event, not a spell (it's not impossible, but easier).

For an interaction spell you can use whatever as long as you remove all art and damage and so on. It would be best to make it target a unit instead of point as that gives you the broadest set of possibilities. Unless of course you make two interaction spells. The hard part isn't making the spell it's making objects and areas react correctly to your spell. Give me an example of something you want to happen then I can point you in the right direction.

Personally I would never use an interaction spell simply because I can use attack/stop or other events to trigger what I need. Separate items that can be used on different locations etc.

Oh so u recommend me to just... idk replace lets say Patrol icon with my action icon and rename it to interact, and then trigger it so that
unit = does patrol
event= instead do something else
if i got it correctly?? could work, gonna experiment with that

You should base the spell (and most custom spells) on Channel ('Ancl'): Spells - Channel. The way you described it with regions is pretty much the easiest way to get this to work:

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to INTERACT
  • Actions
    • Set U = (Triggering Unit)
    • If (Conditions) then (Actions) else (Actions)
      • If - Conditions
        • (Book Region 1 <gen> contains U) equal to true
      • Then - Actions
        • -------- do stuff for book region 1 --------
      • Else - Actions
    • If (Conditions) then (Actions) else (Actions)
      • If - Conditions
        • (Book Region 2 <gen> contains U) equal to true
      • Then - Actions
        • -------- do stuff for book region 2 --------
      • Else - Actions
    • If (Conditions) then (Actions) else (Actions)
      • If - Conditions
        • (Book Region 3 <gen> contains U) equal to true
      • Then - Actions
        • -------- do stuff for book region 3 --------
      • Else - Actions
You could also do something like this where you set up a bunch of points beforehand and check the distance to each point:
  • Events
    • Time - Elapsed game-time is 0.10 seconds
  • Conditions
  • Actions
    • Set InteractCount = (InteractCount + 1)
    • Set InteractPoint[InteractCount] = Center of Book Region 1 <gen>
    • Set InteractDistance[InteractCount] = 150.00
    • Set InteractTrigger[InteractCount] = Do Stuff with Books 1 <gen> //these are triggers you make for each possible interact
    • Set InteractCount = (InteractCount + 1)
    • Set InteractDistance[InteractCount] = 150.00
    • Set InteractPoint[InteractCount] = Center of Book Region 2 <gen>
    • Set InteractTrigger[InteractCount] = Do Stuff with Books 1 <gen> //can re-use triggers for multiple interactions
    • Set InteractCount = (InteractCount + 1)
    • Set InteractDistance[InteractCount] = 30.00 //have to be really close to this book to get it to work
    • Set InteractPoint[InteractCount] = Center of Book Region 3 <gen>
    • Set InteractTrigger[InteractCount] = Do Stuff with Books 3 <gen>
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to INTERACT
  • Actions
    • Set InteractUnit = (Triggering Unit)
    • Set InteractPos = (Position of U)
    • For each Integer InteractCheck from 1 to InteractCount do (Actions)
      • Loop - Actions
        • If (Conditions) then (Actions) else (Actions)
          • If - Conditions
            • (Distance between P and InteractPoint[InteractCheck]) less than InteractDistance[InteractCheck]
          • Then - Actions
            • Trigger - Run InteractTrigger[InteractCount] (Checking conditions)
          • Else - Actions
    • Custom script: call RemoveLocation(udg_InteractPos)
And an example of what perhaps Do Stuff with Books 1 looks like:
  • Events
    • -------- doesn't need any, is run manually --------
  • Conditions
    • ((Interact Unit) has buff Supreme Knowledge) equal to true //only works when you have this buff
  • Actions
    • Item - Create 1 Awesome Book at InteractPos
    • Sound - Play somesound <gen>

Wou thats a very in depth answer, very helpful ty wm. Likely will use this system or similiar, still not fully done with map events and stuff so i wanna have all of them preplaned and doodah wise placed before i get to making the events happen, but ty wm

+Rep to both
 
Oh so u recommend me to just... idk replace lets say Patrol icon with my action icon and rename it to interact, and then trigger it so that
unit = does patrol
event= instead do something else
if i got it correctly?? could work, gonna experiment with that



Wou thats a very in depth answer, very helpful ty wm. Likely will use this system or similiar, still not fully done with map events and stuff so i wanna have all of them preplaned and doodah wise placed before i get to making the events happen, but ty wm

+Rep to both

No I mean to actually attack the unit/thing you want to interact with and then using a trigger to stop the attacking unit from attacking. I don't have access to a WE right now but I can try to write it by freehand:

  • Events
    • Unit - A unit is attacked
  • Conditions
    • (Triggering unit) equal to AttackedUnit
    • (Attacking unit) equal to YourUnit
  • Actions
    • Unit - Order (Attacking unit) to Stop
Then after this you put whatever functions you want to happen when that unit is attacked/interacted with.

@Pyrogasm's way is a lot better though.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,011
No I mean to actually attack the unit/thing you want to interact with and then using a trigger to stop the attacking unit from attacking. I don't have access to a WE right now but I can try to write it by freehand:

  • Events
    • Unit - A unit is attacked
  • Conditions
    • (Triggering unit) equal to AttackedUnit
    • (Attacking unit) equal to YourUnit
  • Actions
    • Unit - Order (Attacking unit) to Stop
Then after this you put whatever functions you want to happen when that unit is attacked/interacted with.

@Pyrogasm's way is a lot better though.
Note that this won't work without putting a wait of 0 seconds before ordering to stop.
 
Level 2
Joined
May 18, 2018
Messages
18
Maybe you would like to share it?
uh sure basically i made an ability thats a dummy and does nothing upon activation, and if its casted in the region where i need the interaction to happen, action happens, otherwise, nothing happens. I used button stacking to remove patrol as well, thanks to a guide i found.

But since ur here, could i ask u for one more advice?
how do i change the text or UI buttons (hold position, move, stop) etc cuz i tought it would be in game interface but it aint, i just wanna recollor them to match my spell description collors
 
uh sure basically i made an ability thats a dummy and does nothing upon activation, and if its casted in the region where i need the interaction to happen, action happens, otherwise, nothing happens. I used button stacking to remove patrol as well, thanks to a guide i found.

But since ur here, could i ask u for one more advice?
how do i change the text or UI buttons (hold position, move, stop) etc cuz i tought it would be in game interface but it aint, i just wanna recollor them to match my spell description collors

I'm not sure how to actually change their position, but you can change their icons in the advanced interface or something like that. You can find numerous icons in the icons section.
 
Level 2
Joined
May 18, 2018
Messages
18
I'm not sure how to actually change their position, but you can change their icons in the advanced interface or something like that. You can find numerous icons in the icons section.
i know icons. I changed their icons. But i need to change their text, add some color and stuff. And i couldnt find Text bases for basic movement buttons in the ui constants.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,011
i dont think that has anything to do with what im asking / talking about
It has absolutely everything with what you asked from your last post.
But since ur here, could i ask u for one more advice?how do i change the text or UI buttons (hold position, move, stop) etc cuz i tought it would be in game interface but it aint, i just wanna recollor them to match my spell description collors
My post said how you edit the text and change UI buttons position.
 
Status
Not open for further replies.
Top