[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums | Starcraft II |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > Triggers & Scripts

Triggers & Scripts Discussions regarding GUI triggers & JASS/AI scripts may be found here. Please review the » JASS Tutorials » Trigger Tutorials

Closed Thread
 
LinkBack Thread Tools
Old 07-03-2009, 06:52 PM   #1 (permalink)
Registered User Craphter
User
 
Join Date: Jun 2009
Posts: 140
Craphter has little to show at this moment (6)
Healing a thousand HP

I decided to make a personalized pot, but I couldnt find anything in a trigger that healed 1000 hp for a especific unit (if you know, please let me know)
So Ive decided to learn JASS, and I got this far:


Jass:
//Start
Function Potion takes unit u returns noting
local unit u
loop
set u = Player(1)
exitwhen u == null
call unitstate(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_MAX_LIFE))
endloop
endfunction
//End


But that would only heal all the HP of a unit, wich I dont want...
What do I do next?
Thnks
__________________
Craphter is offline  
Old 07-03-2009, 06:57 PM   #2 (permalink)
Registered User Reaper2008
Greek JASSer...
 
Reaper2008's Avatar
 
Join Date: Jul 2008
Posts: 1,166
Reaper2008 is a jewel in the rough (215)Reaper2008 is a jewel in the rough (215)Reaper2008 is a jewel in the rough (215)
Jass:
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u,UNIT_STATE_LIFE) + 1000)
__________________
Reaper2008 is offline  
Old 07-03-2009, 07:09 PM   #3 (permalink)
Registered User Saia_Djinn
The One and Only
 
Saia_Djinn's Avatar
 
Join Date: Feb 2009
Posts: 469
Saia_Djinn is on a distinguished road (86)Saia_Djinn is on a distinguished road (86)
Quote:
Originally Posted by Craphter View Post

Jass:
//Start
Function Potion takes unit u returns noting
local unit u
loop
set u = Player(1)// u cant set unit to a player u need GetTriggerUnit()
exitwhen u == null// and not a loop

call unitstate(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_MAX_LIFE))
endloop
endfunction
//End
so thats what it should be

Jass:
function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call SetUnitState( u , UNIT_STATE_LIFE , GetUnitState( u , UNIT_STATE_LIFE) + 1000 )
endfunction
__________________

Last edited by Saia_Djinn; 07-03-2009 at 08:46 PM.
Saia_Djinn is offline  
Old 07-03-2009, 07:58 PM   #4 (permalink)
Registered User Amigurumi
yarr harr!
 
Amigurumi's Avatar
 
Join Date: Apr 2008
Posts: 1,707
Amigurumi is a glorious beacon of light (516)Amigurumi is a glorious beacon of light (516)Amigurumi is a glorious beacon of light (516)Amigurumi is a glorious beacon of light (516)Amigurumi is a glorious beacon of light (516)
@ Saia_Djinn: you forgot one bracket in line 3:
Jass:
call SetUnitState( u , UNIT_STATE_LIFE , GetUnitState( u , UNIT_STATE_LIFE) + 1000 )
__________________
Announcement
Since I'm quitting the wc3 modding business,
all my resources (maps and icons excluded), are free to edit,
as long you give credits to me
(and to the person who helped me, if there is one).

This doesn't give you the permission to upload my
resources to other sites!
Amigurumi is offline  
Old 07-03-2009, 08:45 PM   #5 (permalink)
Registered User Saia_Djinn
The One and Only
 
Saia_Djinn's Avatar
 
Join Date: Feb 2009
Posts: 469
Saia_Djinn is on a distinguished road (86)Saia_Djinn is on a distinguished road (86)
yeah i made this pseudo so fails can happen but thx ill fix =D
__________________
Saia_Djinn is offline  
Old 07-03-2009, 09:17 PM   #6 (permalink)
Registered User Dr Super Good
User
 
Dr Super Good's Avatar
 
Join Date: Jan 2005
Posts: 8,135
Dr Super Good has a brilliant future (1323)Dr Super Good has a brilliant future (1323)Dr Super Good has a brilliant future (1323)Dr Super Good has a brilliant future (1323)Dr Super Good has a brilliant future (1323)Dr Super Good has a brilliant future (1323)
Why does he not just set the standard pot abilities to heal 1000 and give it to an item?
Dr Super Good is offline  
Old 07-03-2009, 09:35 PM   #7 (permalink)
Registered User Marsmallos
User
 
Join Date: May 2008
Posts: 46
Marsmallos has little to show at this moment (2)
why not just

Unit - set life of (triggering unit) to (life of (triggering unit) + 1000)

replace (triggering unit) with whatever is needed in your trigger
Marsmallos is offline  
Old 07-03-2009, 10:02 PM   #8 (permalink)
Registered User Super-Sheep
:l
 
Super-Sheep's Avatar
 
Join Date: Oct 2006
Posts: 2,301
Super-Sheep is a jewel in the rough (188)Super-Sheep is a jewel in the rough (188)
Because he is trying to learn JASS? Everybody start from the bottom.
Super-Sheep is offline  
Old 07-03-2009, 10:13 PM   #9 (permalink)
Registered User Slaydon
STARCRAFT 2 :D
 
Slaydon's Avatar
 
Join Date: Jan 2008
Posts: 2,527
Slaydon is just really nice (382)Slaydon is just really nice (382)Slaydon is just really nice (382)Slaydon is just really nice (382)
isnt jass First gui, then fixed up in Jass?
__________________
Signature - Best Guide Ever - Another good Guide - A MUST SEE VID
Slaydon is offline  
Old 07-03-2009, 10:14 PM   #10 (permalink)
Registered User Super-Sheep
:l
 
Super-Sheep's Avatar
 
Join Date: Oct 2006
Posts: 2,301
Super-Sheep is a jewel in the rough (188)Super-Sheep is a jewel in the rough (188)
Okay I didnt read the "but I couldnt find anything in a trigger that healed 1000 hp for a especific unit" part.
Super-Sheep is offline  
Old 07-03-2009, 10:28 PM   #11 (permalink)
Registered User Deaod
GUI sucks. Don't use it.
 
Join Date: Nov 2007
Posts: 754
Deaod has disabled reputation
Quote:
isnt jass First gui, then fixed up in Jass?
No. "Fixing" GUI-JASS means rewriting the whole deal.
Deaod is online now  
Old 07-04-2009, 06:00 AM   #12 (permalink)
Registered User Craphter
User
 
Join Date: Jun 2009
Posts: 140
Craphter has little to show at this moment (6)
actually, im trying to learn JASS to actually do this pot...
i just didnt look well enough....
thnks a lot guys (specially Marsmallos)
Now i have one last problem:



Now each time a hero moves the pot, itll give him 1000 htps =(
__________________
Craphter is offline  
Old 07-04-2009, 09:26 AM   #13 (permalink)
Registered User Super-Sheep
:l
 
Super-Sheep's Avatar
 
Join Date: Oct 2006
Posts: 2,301
Super-Sheep is a jewel in the rough (188)Super-Sheep is a jewel in the rough (188)
Utilizaaaa?
Super-Sheep is offline  
Old 07-04-2009, 09:45 AM   #14 (permalink)
Registered User Reaper2008
Greek JASSer...
 
Reaper2008's Avatar
 
Join Date: Jul 2008
Posts: 1,166
Reaper2008 is a jewel in the rough (215)Reaper2008 is a jewel in the rough (215)Reaper2008 is a jewel in the rough (215)
Base it on a tome, and give it an ability that permanently adds 0 whatever.
__________________
Reaper2008 is offline  
Old 07-04-2009, 09:52 AM   #15 (permalink)
Registered User Slaydon
STARCRAFT 2 :D
 
Slaydon's Avatar
 
Join Date: Jan 2008
Posts: 2,527
Slaydon is just really nice (382)Slaydon is just really nice (382)Slaydon is just really nice (382)Slaydon is just really nice (382)
if its A unit gets an item, you could simply make it like this:

Drop Item Being Manipulated
Remove Item being manipulated
Turn off This trigger

maybe?
__________________
Signature - Best Guide Ever - Another good Guide - A MUST SEE VID
Slaydon is offline  
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thousand pounder :D dansaDisco Development 36 07-16-2009 11:26 AM
Thousand Pounder Terrain CloudWolf Screenshots 30 06-22-2009 12:00 PM

All times are GMT. The time now is 09:42 PM.





Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.1
Copyright©Ralle