Login
Register
Menu
Home
Forum
JassDoc
Types
Functions
Variables
Help
Chat
Media
Search
Search posts
WC3 Modding Information Center
For your WC3 needs...
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Triggers & Scripting
GUI
[GUI] No Target Order
Warcraft III:
Maps
Models
Skins
Icons
Spells / Systems
Tools
Tutorials
Snippets
JASS vJASS Spells and Systems
Tutorials
Chat @Discord
[GUI] No Target Order
GUI
Started by
Kam
Views
7738
Replies
2
Users
2
1
2
Pages:
1
Go Down
0 Members and 1 Guest are viewing this topic.
Kam
Beyond the Throne
Lurker - level 4
Posts:
7
WC3 Models: 0
WC3 Tutorials: 0
WC3 Tools: 0
WC3 Maps: 0
WC3 Skins: 0
WC3 Icons: 0
WC3 Spells: 0
Reputation:
101
Blizzard Associate Producer
[GUI] No Target Order
on:
August 05, 2012, 01:44:13 PM
This is fairly simple. I have this ability that when activated converts resources to mana for a casting structure. The primary ability is a dummy ability based on immolation. When activated it adds a dummy ability that catches a every second timed trigger that does the resource conversion.
The problem I discovered is that when you use a "no target" order event anything the structure does starts the trigger, even despite having a condition that immolation/unimmolation be the only acceptable orders.
I mostly solved this by having another trigger that removes the dummy and resets the primary abilities when another type of order is given. This works accept when the building begins construction. How can I solve this?
Conversion Setup
Events
Unit -
A unit Is issued an order with no target
Conditions
Or - Any (
Conditions
) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Rift
(Unit-type of (Triggering unit)) Equal to Bastion
(Unit-type of (Triggering unit)) Equal to Parapet
Or - Any (
Conditions
) are true
Conditions
(Issued order) Equal to (Order(immolation))
(Issued order) Equal to (Order(unimmolation))
Actions
If
(All
Conditions
are True) then do (Then
Actions
) else do (Else
Actions
)
If
-
Conditions
(Level of Mana Conversion (Dummy) for (Triggering unit)) Equal to 0
Then -
Actions
Unit -
Add Mana Conversion (Dummy) to (Triggering unit)
Else -
Actions
If
(All
Conditions
are True) then do (Then
Actions
) else do (Else
Actions
)
If
-
Conditions
(Level of Mana Conversion (Dummy) for (Triggering unit)) Equal to 1
Then -
Actions
Unit -
Remove Mana Conversion (Dummy) from (Triggering unit)
Else -
Actions
Conversion Check
Events
Time -
Every 1.00 seconds of game time
Conditions
Actions
Set Conversion_Group = (Units in (Playable map area) matching ((Level of Mana Conversion (Dummy) for (Matching unit)) Equal to 1))
Unit Group -
Pick every unit in Conversion_Group and do (
Actions
)
Loop -
Actions
If
(All
Conditions
are True) then do (Then
Actions
) else do (Else
Actions
)
If
-
Conditions
((Owner of (Picked unit)) Current gold) Greater than or equal to 5
(Mana of (Picked unit)) Not equal to (Max mana of (Picked unit))
Then -
Actions
Player -
Set
(Owner of (Picked unit)) Current gold to (((Owner of (Picked unit)) Current gold) - 5)
Unit -
Set mana of (Picked unit) to ((Mana of (Picked unit)) + 1.00)
Else -
Actions
If
(All
Conditions
are True) then do (Then
Actions
) else do (Else
Actions
)
If
-
Conditions
((Owner of (Picked unit)) Current lumber) Greater than or equal to 10
(Mana of (Picked unit)) Not equal to (Max mana of (Picked unit))
Then -
Actions
Player -
Set
(Owner of (Picked unit)) Current lumber to (((Owner of (Picked unit)) Current lumber) - 10)
Unit -
Set mana of (Picked unit) to ((Mana of (Picked unit)) + 1.00)
Else -
Actions
Custom script:
call DestroyGroup (udg_Conversion_Group)
Conversion Upgrade Reset
Events
Unit -
A unit Begins an upgrade
Unit -
A unit Finishes an upgrade
Unit -
A unit Cancels an upgrade
Unit -
A unit Begins construction
Unit -
A unit Finishes construction
Unit -
A unit Begins research
Unit -
A unit Cancels research
Unit -
A unit Finishes research
Conditions
Or - Any (
Conditions
) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Rift
(Unit-type of (Triggering unit)) Equal to Bastion
(Unit-type of (Triggering unit)) Equal to Parapet
Actions
Unit -
Remove Mana Conversion (Dummy) from (Triggering unit)
Unit -
Remove Conversion from (Triggering unit)
Unit -
Add Conversion to (Triggering unit)
moyack
Site Owner
Administrator
Posts:
971
WC3 Models: 20
WC3 Tutorials: 17
WC3 Tools: 19
WC3 Maps: 12
WC3 Skins: 0
WC3 Icons: 1
WC3 Spells: 16
Reputation:
1153
Site Admin - I love fix things
Re: [GUI] No Target Order
Reply #1 on:
August 06, 2012, 08:50:34 AM
Hmmm, as far as I understand, the buldings have an ability on/off, and if you order them to... train a unit, they stop or activate the ability...
I need to do a test and probably implement somethign in jass, because in this case the gui triggers are inneficinet as hell.
WC3 Modding Information Center
moyack
Site Owner
Administrator
Posts:
971
WC3 Models: 20
WC3 Tutorials: 17
WC3 Tools: 19
WC3 Maps: 12
WC3 Skins: 0
WC3 Icons: 1
WC3 Spells: 16
Reputation:
1153
Site Admin - I love fix things
Re: [GUI] No Target Order
Reply #2 on:
August 07, 2012, 12:59:26 PM
Well, I've been working on this and I have this code thus far:
Code: jass
scope
ConvertResourcesToMana
initializer
init
globals
private
constant
real
DT = 0.5
private
constant
integer
BUFF =
'BEim'
//Ability buff rawcode
private
constant
integer
AB_OFF = 852178
//The abilities rawcode related to unimmolation.
private
constant
integer
RATE = 10
// set the resource rate
private
constant
real
MANA_RATE = 1.
// set the mana rate
private
timer
T =
CreateTimer
()
endglobals
private
function
Check
takes
nothing
returns
nothing
local
unit
u
local
integer
g
local
integer
l
local
player
p
call
GroupEnumUnitsInRange
(
bj_lastCreatedGroup
, 0,0, 9999999999.,
null
)
loop
set
u =
FirstOfGroup
(
bj_lastCreatedGroup
)
exitwhen
u ==
null
if
GetUnitAbilityLevel
(u, BUFF) > 0
then
set
p =
GetOwningPlayer
(u)
set
g =
GetPlayerState
(p,
PLAYER_STATE_RESOURCE_GOLD
)
set
l =
GetPlayerState
(p,
PLAYER_STATE_RESOURCE_LUMBER
)
if
GetUnitState
(u,
UNIT_STATE_MANA
) ==
GetUnitState
(u,
UNIT_STATE_MAX_MANA
)
or
g < 1
or
l < 1
then
call
IssueImmediateOrderById
(u, AB_OFF)
endif
call
SetPlayerStateBJ
(p,
PLAYER_STATE_RESOURCE_GOLD
, g -
R2I
(RATE * DT))
call
SetPlayerStateBJ
(
GetOwningPlayer
(u),
PLAYER_STATE_RESOURCE_LUMBER
, l -
R2I
(RATE * DT))
call
SetUnitState
(u,
UNIT_STATE_MANA
,
GetUnitState
(u,
UNIT_STATE_MANA
) + MANA_RATE * DT)
endif
call
GroupRemoveUnit
(
bj_lastCreatedGroup
, u)
endloop
endfunction
private
function
init
takes
nothing
returns
nothing
call
TimerStart
(T, DT,
true
,
function
Check)
endfunction
endscope
I still can't make it work when the building trains the unit. The funny thing is that it doesn't stop the order, in fact it "pauses" the building which generates conflict. I will plan to do a modification, checking all the units with the buff.
EDIT: HMMM I've improved the code much more
Now it doesn't stop when the building trains other units but the buff is still present while the building trains. That proves the fact the buildings are paused while builds.
Compare this code with all the stuff you wrote in GUI
Important note:
You will notice that DH will switch off the Immolation ability, it happens because I have not changed the buff ID in the custom ability. If you change it in the code and in the ability it will work fine
«
Last Edit: August 07, 2012, 01:20:24 PM by moyack
»
WC3 Modding Information Center
Print
Pages:
1
Go Up
« previous
next »
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Triggers & Scripting
GUI
[GUI] No Target Order
Random Spells & Systems
Suggested Topics
wc3Borderizer
Started by
cohadar
Replies: 1
Views: 4640
WC3 Editing Tools
[functions] SetTargetHeroes
Started by
moyack
Replies: 1
Views: 578
Jassdoc
[functions] OrderId2String
Started by
City17
Replies: 0
Views: 397
Jassdoc
[functions] OrderId
Started by
City17
Replies: 0
Views: 332
Jassdoc
PortaMx-SEF 1.54
|
PortaMx © 2008-2015
,
PortaMx corp.
Search
Username
Password
Always stay logged in
Forgot your password?