[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, 07: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, 07:57 PM   #2 (permalink)
Registered User Reaper2008
Greek JASSer...
 
Reaper2008's Avatar
 
Join Date: Jul 2008
Posts: 1,165
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, 08: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 09:46 PM.
Saia_Djinn is offline  
Old 07-03-2009, 08:58 PM   #4 (permalink)
Registered User Amigurumi
Shee[P]roductions
 
Amigurumi's Avatar
 
Join Date: Apr 2008
Posts: 1,481
Amigurumi is just really nice (377)Amigurumi is just really nice (377)Amigurumi is just really nice (377)Amigurumi is just really nice (377)
@ Saia_Djinn: you forgot one bracket in line 3:
Jass:
call SetUnitState( u , UNIT_STATE_LIFE , GetUnitState( u , UNIT_STATE_LIFE) + 1000 )
__________________
Amigurumi is online now  
Old 07-03-2009, 09: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, 10:17 PM   #6 (permalink)
Forum Moderator Dr Super Good
Back to normal again. . .
 
Dr Super Good's Avatar
 
Join Date: Jan 2005
Posts: 6,559
Dr Super Good has much of which to be proud (1105)Dr Super Good has much of which to be proud (1105)Dr Super Good has much of which to be proud (1105)Dr Super Good has much of which to be proud (1105)Dr Super Good has much of which to be proud (1105)
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, 10: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, 11:02 PM   #8 (permalink)
Registered User Super-Sheep
iashdiashdiuashdiashidash
 
Super-Sheep's Avatar
 
Join Date: Oct 2006
Posts: 2,217
Super-Sheep is a jewel in the rough (183)Super-Sheep is a jewel in the rough (183)
Because he is trying to learn JASS? Everybody start from the bottom.
Super-Sheep is offline  
Old 07-03-2009, 11:13 PM   #9 (permalink)
Registered User Slaydon
STARCRAFT 2 :D
 
Slaydon's Avatar
 
Join Date: Jan 2008
Posts: 2,438
Slaydon is just really nice (372)Slaydon is just really nice (372)Slaydon is just really nice (372)Slaydon is just really nice (372)
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, 11:14 PM   #10 (permalink)
Registered User Super-Sheep
iashdiashdiuashdiashidash
 
Super-Sheep's Avatar
 
Join Date: Oct 2006
Posts: 2,217
Super-Sheep is a jewel in the rough (183)Super-Sheep is a jewel in the rough (183)
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, 11:28 PM   #11 (permalink)
Registered User Deaod
GUI sucks. Don't use it.
 
Join Date: Nov 2007
Posts: 687
Deaod is a jewel in the rough (204)Deaod is a jewel in the rough (204)
Quote:
isnt jass First gui, then fixed up in Jass?
No. "Fixing" GUI-JASS means rewriting the whole deal.
Deaod is offline  
Old 07-04-2009, 07: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, 10:26 AM   #13 (permalink)
Registered User Super-Sheep
iashdiashdiuashdiashidash
 
Super-Sheep's Avatar
 
Join Date: Oct 2006
Posts: 2,217
Super-Sheep is a jewel in the rough (183)Super-Sheep is a jewel in the rough (183)
Utilizaaaa?
Super-Sheep is offline  
Old 07-04-2009, 10:45 AM   #14 (permalink)
Registered User Reaper2008
Greek JASSer...
 
Reaper2008's Avatar
 
Join Date: Jul 2008
Posts: 1,165
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, 10:52 AM   #15 (permalink)
Registered User Slaydon
STARCRAFT 2 :D
 
Slaydon's Avatar
 
Join Date: Jan 2008
Posts: 2,438
Slaydon is just really nice (372)Slaydon is just really nice (372)Slaydon is just really nice (372)Slaydon is just really nice (372)
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 12:26 PM
Thousand Pounder Terrain CloudWolf Screenshots 30 06-22-2009 01:00 PM

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






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