(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > 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

Reply
 
LinkBack Thread Tools Display Modes
Old 11-20-2008, 01:34 AM   #466 (permalink)
 
Herman's Avatar

Me in a few words???
 
Join Date: Aug 2007
Posts: 949

Herman has little to show at this moment (40)Herman has little to show at this moment (40)Herman has little to show at this moment (40)Herman has little to show at this moment (40)Herman has little to show at this moment (40)


Quote:
Originally Posted by SanKakU View Post
ok, well, it seems to me like you are supposed to destroy locations and unit groups and those kinds of things...and i thought you were supposed to null them also...but someone said you don't null unit groups?

so what do you null and what do you destroy? and like, i'm pretty sure locations need to be nulled...but i saw on someone's map they are not nulled and it's a good triggered map so i don't understand.... some help? it is very confusing.

what needs to be nulled and what needs to be destroyed? and is there an order to nulling and destroying when you have to do both?

err...let me see if i got this right...i just read the msg by spiwn again...

no global variables need nulling... so that means just local variables need nulling right? well...oops.

so how do you treat the local variables? how does the nulling and destroying work there?
I'll try to explain it, I might even write a tutorial on it. Handles are objects in the game, big pieces of data. They take alot of the CPU's power/speed/energy/memory/whatever you'd like to call it. To avoid using too much memory, programmers destroy/remove these handles. When the handle is not removed when your finished using it, it is considered a leak. Now the confusing part is 'nulling'. Due to how WarIII's system runs, the handles will not be removed if variables are pointing to it. There is an explanation as to why this occurs, but its not to important. Please also note about variables, variables simply 'point' to the object, they are not the actual object (the handle is).

Sometimes you don't need to destroy handles if your re-using them (if you don't destroy them, you don't need to worry about 'nulling' them). With certain variables, they say you don't need to null them, because you are constantly re-using them (in other words, your pointing the variable to something else [which we usually use null for], thus allowing the handle to be removed appropriately). That should about cover it.
__________________
77% of all people are neurotic
Herman is offline   Reply With Quote
Old 11-20-2008, 03:29 AM   #467 (permalink)
 
SanKakU's Avatar

The Host of TDHT
 
Join Date: May 2008
Posts: 136

SanKakU has little to show at this moment (7)


well anyway obviously what spiwn said is totally wrong...i don't understand what you're saying but it doesn't sound like much...

but i went ahead and took out all the nulling for the global variables and instead of the annoying black screen bug that sometimes happened to players and usually happened in the replays...i got everyone disconnected within the first ten minutes of every game!

that is extremely annoying and as you can see...it disproves what he told me.

if Herman or whoever honestly knows what's what then PLEASE look at my map and explain to me how i need to be editing these triggers.

the nulling the global variables apparently is necessary, at any rate...because without it my map disconnects everyone. but is the overnulling what's causing the black screen bug? how come no one has ever explained what that is? no one seems to know what it is, as if i'm the only one running into it.

do a full house on my map and watch the replay after the game.
it should do a weird black screen sometimes and maybe even crash. but at least it operates better than no nulling the globals.
__________________
SanKakU is offline   Reply With Quote
Old 11-20-2008, 06:22 AM   #468 (permalink)
 
spiwn's Avatar

Fast Learning retard
 
Join Date: Apr 2008
Posts: 1,076

spiwn will become famous soon enough (92)spiwn will become famous soon enough (92)spiwn will become famous soon enough (92)


Quote:
Originally Posted by SanKakU View Post
well anyway obviously what spiwn said is totally wrong...i don't understand what you're saying but it doesn't sound like much...

but i went ahead and took out all the nulling for the global variables and instead of the annoying black screen bug that sometimes happened to players and usually happened in the replays...i got everyone disconnected within the first ten minutes of every game!

that is extremely annoying and as you can see...it disproves what he told me.

if Herman or whoever honestly knows what's what then PLEASE look at my map and explain to me how i need to be editing these triggers.

the nulling the global variables apparently is necessary, at any rate...because without it my map disconnects everyone. but is the overnulling what's causing the black screen bug? how come no one has ever explained what that is? no one seems to know what it is, as if i'm the only one running into it.

do a full house on my map and watch the replay after the game.
it should do a weird black screen sometimes and maybe even crash. but at least it operates better than no nulling the globals.
The only one who does not know "what it is" is you.
You are skimming the text. There already is(are) tutorial(s) on variables.
Like this one. But people do not seem to go in the tutorial section these days.
No I am not wrong. Global variables need not to be nulled, but they have to be destroyed removed(there are some exceptions like recycling or using only a limited number of variables - like 1! unit group).

It has been said many times over, so I am not going to write it from scratch.
If you want to know about handles and pointers here:

Quote:
Originally Posted by spiwn
To fully understand why global variables do not have to be nulled you would have to understand what a variable of type any handle(unit, group and etc - everything except integer, real, boolean, string( I may miss something) is.
Lets say we have a variable of type unit.
Since this is a handle, not one of the basic types, the variables does not carry all the data about the unit.
Ah, confusing. For example an integer variables stores the actual integer. But with a unit(handle) that would be impossible(there is a lot of data connected with it- position height, health and etc). So blizzard most probably made their own structures - unit, group and etc.
When you create a unit, the structures is created. When you store the unit in a variable a pointer/index/address to that structures is stored in the memory(it is a way to show where in the memory the data for that unit is stored). So when you use something like
set temp_unit=bj_lastcreatedunit
War3 retrieves that address(which is a number(integer), but like 0x9002305 (example only) ) and stores it.
When you call that temp_unit war3 finds what address is stored in the variable and refers to the structure at that adress.
So every variable of type handle is actually an integer that shows the address of some structure, but a bit different, because war3 does not erase it.
The H2I function(rather famous, if you have not heard of it search(most systems use it)) uses this, and when you use something like H2I(temp_unit) it will return the address/pointer/index that is stored in temp_unit.
Here there is one important thing to learn - while an address of some structures exists, anywhere - local or global, that structure address cannot be used again, even if the actual structure is destroyed. And because addresses get used and never freed, the address of the next created structure will be bigger. All those local variables that point to some structure will take memory. Addresses will continue to increase, memory taken by pointers will increase, resulting in lag, and eventually in a game crash.

So lets examine local and global variables.
If you use a local and do not null it, at the end of the function you will no longer be able to access it - change it, erase it or whatever. And since it is pointing to some structure, that address cannot be used ever again, so you must null it.
But when you use globals you can always access that variable.
So:
set udg_temp_unit = Blah
It stores some address in udg_temp_unit. Now you would think that this is the same as a local variable. Well you are not wrong - again until the pointer is not removed, it will use up an address.
Ah, but with globals, you can access them again:
set udg_temp_unit= Blah2
Now udg_temp_unit is assigned a different pointer, but the old one is erased, so the index is freed.

I have realized this, by reading a lot of tutorials, examining the H2I and studying user structures(vJass). Yes it is rather true.
I explained it the simplest way I could. I will not be surprised if you do not understand it from the first time. Whether you understand it ever depends only on you(some people just think other ways ;) ).
If you want to understand this/ become proficient with jass, I suggest you keep it, read tutorial, practice and read it again(until you understand it).
Note that understanding this is not really necessary to become a good "jasser". You actually can just remember this: Null locals, do not null Globals.


Only string, real, integer, code, boolean are not "structured". They are basic. I think they are included in most programming languages.
Everything else is a structure of those( in all languages).
Player structures probably include IPs, handicap, color, player name etc.
Units, groups, locations, player and etc are Handles (that is what blizzard calls them ( to fully understand what a handle is a very advanced thing must be learned - Interfaces, but since I have not even started learning about those, I cannot explain this to you)).
Since Blizzard did no and still do not wish to share how they have created handles this structure theory is just a smart guess. People do not call them structures, that is just something I figured would be most suitable to explain about them.

Quote:
Originally Posted by PurplePoot
Because handles have an internal reference counter which is increased when they're referenced and decreased when they are dereferenced, and if it's >0 their handle id can't be recycled.
We cannot be 100% sure - it is illegal to peak in blizzards code.
But we can test it:
function U2I takes unit u returns integer
return u
return 0
endfunction

function Trig_testvars_Actions takes nothing returns nothing
local integer i=0
local integer max=0
local integer ti
local unit array u[1000]
loop
exitwhen i==1000
set u[i]=CreateUnit(Player(0),'hfoo',0,0,0)
set ti=U2I(u[i])
call RemoveUnit(u[i])
//set u[i]=null //enable this for second test
if(max<ti) then
set max=ti
call BJDebugMsg("Current address is " + I2S(max))
endif
if((i-(i/5)*5)==0) then //To prevent lagg
call TriggerSleepAction(-1)
endif
set i=i+1
endloop
endfunction
Result for first test should be 1000 numbers displayed on screen. And from second, only 5(because the handle index cannot be freed while war 3 is executing something else(like this function), so when the trigger sleep action is called wc3 moves on does things(like freeing handle indexes) and comes back here to continue).
I wrote that a long time ago for someone else.
Because I am sure you are going to miss it, I am gonna take it out of the quote:
So lets examine local and global variables.
If you use a local and do not null it, at the end of the function you will no longer be able to access it - change it, erase it or whatever. And since it is pointing to some structure, that address cannot be used ever again, so you must null it.
But when you use globals you can always access that variable.
So:
set udg_temp_unit = Blah
It stores some address in udg_temp_unit. Now you would think that this is the same as a local variable. Well you are not wrong - again until the pointer is not removed, it will use up an address.
Ah, but with globals, you can access them again:
set udg_temp_unit= Blah2
Now udg_temp_unit is assigned a different pointer, but the old one is erased, so the index is freed.
__________________

Use the reputation system for people you think deserve it.
Bux.to - Get Money for viewing ads
spiwn is offline   Reply With Quote
Old 11-20-2008, 01:45 PM   #469 (permalink)
 
SanKakU's Avatar

The Host of TDHT
 
Join Date: May 2008
Posts: 136

SanKakU has little to show at this moment (7)


Quote:
Originally Posted by spiwn View Post
The only one who does not know "what it is" is you.
You are skimming the text. There already is(are) tutorial(s) on variables.
Like this one. But people do not seem to go in the tutorial section these days.
No I am not wrong. Global variables need not to be nulled, but they have to be destroyed removed(there are some exceptions like recycling or using only a limited number of variables - like 1! unit group).
saying what you are saying is fine if i could understand what you're talking about...please give me some examples!
like, what are those exceptions.
and it's not like i don't read the tutorials. it just so happens that alot of the information in them is irrelevant and hard to understand most of the time. especially annoying is lack of examples or them not showing examples properly. one of my biggest gripes is when they say this or that and i don't know what 'this' or 'that' is that they are referring to.
so like i said, please go over my map and give me examples of what destroying and nulling needs to be done. i'll check out that link for that tutorial you put in there in the meantime.

your way of explaining it was wrong, regardless of whether you know what is what, you have a horrible time explaining it.

edit: so that's what a widget is...lol cool, i learned one useful thing at least.
yeah everytime these guys explain something hard to understand they don't use an example, so i don't understand it. then, when they explain something even harder to understand they do use an example and don't explain the example very well.
ok i also learned != is not equal to. well, that's about it. there was a lot of important information in that tutorial and i didn't really understand it.

ok, i'm looking over a tutorial that i've read before and noticing that perhaps there are still more variables that are leaking...like my items. i am using items alot now so maybe those are leaking...i'll look into that. hmm...nope, i can't remove items variables. weird. oh there's a destroy item pool function too.
edit2: whoa whoops i was using the standard world editor, that's why it wouldn't let me remove the items, lol...stupid standard world editor. why doesn't blizzard update that piece of trash?
__________________

Last edited by SanKakU; 11-20-2008 at 03:13 PM..
SanKakU is offline   Reply With Quote
Old 11-20-2008, 02:23 PM   #470 (permalink)
 
spiwn's Avatar

Fast Learning retard
 
Join Date: Apr 2008
Posts: 1,076

spiwn will become famous soon enough (92)spiwn will become famous soon enough (92)spiwn will become famous soon enough (92)


Quote:
Originally Posted by SanKakU View Post
saying what you are saying is fine if i could understand what you're talking about...please give me some examples!
like, what are those exceptions.
and it's not like i don't read the tutorials. it just so happens that alot of the information in them is irrelevant and hard to understand most of the time. especially annoying is lack of examples or them not showing examples properly. one of my biggest gripes is when they say this or that and i don't know what 'this' or 'that' is that they are referring to.
so like i said, please go over my map and give me examples of what destroying and nulling needs to be done. i'll check out that link for that tutorial you put in there in the meantime.

your way of explaining it was wrong, regardless of whether you know what is what, you have a horrible time explaining it.

edit: so that's what a widget is...lol cool, i learned one useful thing at least.
I beg to differ. You are the first to complain about my way of explaining and you seem to complain about all tutorials. Logically I come to the conclusion that the problem is not with me, not with my explaining, not with all the tutorials, but with you.
An example ... hah.
I was right :D
I knew you would miss it and I "highlighted" it. And yet again you missed it...

Quote:
You are skimming the text.
You missed the single most important example. You have learned what a widget is, but that was a personal tutorial on handles (wtf).

Read it, while paying attention to it. This is not something you just have to read without understanding it.

In my previous post I have given you all the information you need to understand what a handle is. Only that information, in the simplest way possible. It is stripped from any connection to Objects, yet it is only about them, in order to make it very simple. Heck a person with basic programming knowledge - primitive variables and memory, and maybe some logic would be able to understand it. I have to admit that it is not very systematized, but it is understandable.

My guess is you do not have any idea what you are doing while triggering. To you "remove", "destroy" and etc are just some abstract terms without any meaning, but they do have.

Read this when you understand what destroy means:
Guess when you do not destroy a global handle ... when you are going to use it again.
__________________

Use the reputation system for people you think deserve it.
Bux.to - Get Money for viewing ads
spiwn is offline   Reply With Quote
Old 11-20-2008, 03:04 PM   #471 (permalink)
 
darkrider's Avatar

Sacred War Editor
 
Join Date: Dec 2007
Posts: 570

darkrider has little to show at this moment (40)darkrider has little to show at this moment (40)darkrider has little to show at this moment (40)darkrider has little to show at this moment (40)darkrider has little to show at this moment (40)


if you have a basic knowledge of programming you understand in deep what you are doing... if you dont... you do it by heart coz people say it (im that case... i started doing leaks removal coz people say it and my map got a lot better... later i started studying a career regarding rogramming so now i understand a little bit more, even though im still very basic)

What you need to know is that you must remove Unit groups when you are gonna use them in a spell trigger IE: if you pick every unit in range, etc
IE of when you are not gonna destroy a unitgroup is for ie you created a dummy unitgroup because you dont want your dummys to be affected by some trigger

you need to remove locations ALL OF THEM NO MATTER WHAT

you need to remove regions when created via triggers (also need to remove points in pre-existant regions coz those are LOCATIONS)
you MUST NOT remove pre-placed regions coz those are CONSTANTS not VARIABLES

you need to destroy playergroups when created via triggers (the same as unit groups) but you MUST NOT destroy ALL PLAYERS coz that is also a constant

For further knowledge read tutorials about handles (but nulling them for IE: units is not THAT important coz the will be replaced but LOCATIONS, UNIT GROUPS, PLAYER GROUPS AND REGIONS are VITAL to be removed

If you want an example of a map full of intentional leaks i can give you one and you can tell me what happens to you


guess thats all

PS: sounds MSUT NOT be removed coz those are also CONSTANTS
darkrider is offline   Reply With Quote
Old 11-22-2008, 02:01 AM   #472 (permalink)
 
SanKakU's Avatar

The Host of TDHT
 
Join Date: May 2008
Posts: 136

SanKakU has little to show at this moment (7)


"If you want an example of a map full of intentional leaks i can give you one and you can tell me what happens to you "

you mean you want to show me a training map or something? alright, i guess. i'll try whatever.

and spiwn, your posts make less sense than the tutorials, and trust me, i tried really hard to understand every single tutorial i've read. your posts are definitely another story. furthermore, i understand the part about global being similar to local, what i don't get isn't the difference between local and global...it's about what needs to be done with what beyond that simple difference.

for example...how many variables should i use of each type? should some/all/none of them have arrays? what factors would influence these things? is it good to have a lot of variables? is that better than fewer? what are general rules to avoid memory leak involving all this?

like, previously, i would put everything in one point for casting of spells at a target location or something like that right? that is it would all be the same variable called point, but now i wonder if since it is a global variable, it is getting used simultaneously and that's causing problems...that's just one example of the minefield in my way of trying to make my map memory leak free. i guess for the most part...what mostly leaks is variables, right? improperly using them, that is...

anyway...as for spiwn, could you please explain this sentence?:
Global variables need not to be nulled, but they have to be destroyed removed(there are some exceptions like recycling or using only a limited number of variables - like 1! unit group).

what is this 1! unit group? and what are the exceptions, and what is this recycling?

and why do you feel like you have to be insulting? a widget is a type of handle...right? so isn't that why they put it in the handle tutorial? psh i don't know but i know a widget like a destructable, an item and like a unit...that's about all i know from all that.

and this sentence...

Read this when you understand what destroy means:
Guess when you do not destroy a global handle ... when you are going to use it again.

huh????? seriously...where's Herman or whoever when you need him?

so i guess the basics of what i need to know might be things like...
so i have a trigger whose events fire often, and then the trigger uses a global variable.
should that global variable be different from every other global variable? i'm guess that is the case. now, since this trigger is fired often and the variable is thus changed alot, does that mean that since the variable IS different from every other variable that not destroying and nulling it is ok? now there are exceptions, right? like locations, right? and what about unit groups? etc... kinda like what dark rider said above eh? am i on the right track at this point or am i still missing something?
__________________

Last edited by SanKakU; 11-22-2008 at 02:39 AM..
SanKakU is offline   Reply With Quote
Old 11-22-2008, 09:29 AM   #473 (permalink)
 
spiwn's Avatar

Fast Learning retard
 
Join Date: Apr 2008
Posts: 1,076

spiwn will become famous soon enough (92)spiwn will become famous soon enough (92)spiwn will become famous soon enough (92)


Argh... this is gonna be a hard one. As I said(several times) all the info is there.

But anyways:
! is the mark for only. 1! means one and only one.
Using a single group - create it at map initialization, then in every trigger use it - add units to it with the Group Enum functions, do some actions with the group and clear it at the end of the trigger.
Recycling is when you only use a limited number of handles of some type. For instance timers. You use lets say only 100 timers in your map. When you are done with one of them, you call a function that pauses it and "frees" it. So instead of creating and destroying timers all the time, you create 100 and then restart them.

Is it an insult to say that one does not want to understand what he ask others to teach him. Because if you wanted, you would already know. My "personal tutorial" has been tested and proven understandable.

Widgets are a subgroup of handles, but widgets are a whole lot different than handles. Only important thing about handles is indexing, destroying them and nulling. And widgets are ... just things you can actually see in the map. They do not get their index as widgets, but as handles. They are a child of handles, they extends handles. So they have nothing to do with this "issue" and yet you learned about them.

You asked for the exceptions I mentioned. So I told you. You do not destroy a global handle variable when you are going to use that very same handle again. Like having global variables for each hero and etc.

As I said, you have no idea what you are making triggers.
Triggers are not executed simultaneously. Wc3 can't do that. So if your trigger does not have a wait and it uses global variables it will work fine.
So using variables as temp_point temp_unit and etc is fine and normal for GUI. And you only have to have about 1,2 such variables in your entire map. More than one for triggers where you need to store two points(locations) (for instance).
What darkrider said is a general guide which variables to destroy. It ain't wrong, but it is not complete, because all handles you are not going to use anymore should be destroyed (or recycled). When you create a unit group with "set temp_group= Unit in 500 range of temp_point1" than you use the group, like pick all units in group and do actions, When you are done with the group you use "call DestroyGroup(g)".
Quote:
Originally Posted by SanKaKu
now, since this trigger is fired often and the variable is thus changed alot, does that mean that since the variable IS different from every other variable that not destroying and nulling it is ok? now there are exceptions, right?
Wrong. When triggers fire often it is most important to destroy and null. Or else there will be memory and/or index leaks every time it fires and since the trigger fires a lot, there will be a lot of leaks.
Here is an example of a leak free trigger:
Leak free trigger
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Footman
Actions
Set temp_point = (Position of (Triggering unit))
Set temp_group = (Units within 512.00 of temp_point)
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
Unit - Kill (Picked unit)
Custom script: call RemoveLocation(udg_temp_point)
Custom script: call DestroyGroup(udg_temp_group)
Without the last two lines, it would leak.
As I said, to fully understand why you do not need to null global variables, you need to understand what exactly handles are, but you do not have to do it, to make leak free triggers. You just have to remember to destroy/remove handles you are not going to use anymore and if they are local, you need to null them.
__________________

Use the reputation system for people you think deserve it.
Bux.to - Get Money for viewing ads
spiwn is offline   Reply With Quote
Old 11-22-2008, 05:19 PM   #474 (permalink)
 
Herman's Avatar

Me in a few words???
 
Join Date: Aug 2007
Posts: 949

Herman has little to show at this moment (40)Herman has little to show at this moment (40)Herman has little to show at this moment (40)Herman has little to show at this moment (40)Herman has little to show at this moment (40)


@ Sankaku

I highly suggest learning JASS, GUI is very difficult when it comes to understanding handles + leaks
__________________
77% of all people are neurotic
Herman is offline   Reply With Quote
Old 11-22-2008, 06:12 PM   #475 (permalink)
 
SanKakU's Avatar

The Host of TDHT
 
Join Date: May 2008
Posts: 136

SanKakU has little to show at this moment (7)


Well, i have learned a little JASS.

I've read the tutorials about JASS but out of everything what helps me the most is maps with systems that I can edit to suit my needs while I learn some JASS at the same time...

I can continue with this sort of thing and I think it helps, can anyone recommend some maps that do this sort of thing?

For example, In the tutorial about Item Pools, there is the map with Neutral Hostile units, when they die they drop items. Well, I used JASS with that trigger and I changed it from Neutral Hostile to specific units that are killed in a specific way. What I did for that was to create the events and conditions in the GUI and converted it to JASS. Then I took the actions and edited them, and put them in the converted trigger, and so on.

This is one sort of way I have learned JASS. But at this point, I'm just using other people's material. I know that good JASS users can make up their own material right? I have not progressed that far yet. If I keep using others' material, I will learn enough to probably make up some stuff on my own, I guess. But the challenge is finding simple enough systems that I can learn from, I suppose.

EDIT: ok, so i went ahead and checked out that kodo tag extreme 4.1 map, and it didn't crash, so i guessed that the triggers it uses would have actions that i need to put in my map to prevent memory leak. and guess what? looking at that worked! when spiwn said that you don't need to null the global variables, he's probably right, but, what it seems like he failed to mention is how to remove them(technically he did say how to remove them, but he used those custom text actions). i thought i was supposed to use custom text, but when i used the gui actions that were in the kodo tag map in place of the custom text actions that i had...my map stopped crashing. on a side note...with these special actions you cannot open such a map with the standard world editor. it will display alot of errors and then finally crash.
check it out:
Actions
Do Multiple ActionsFor each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
If (((Player((Integer A))) controller) Equal to (==) Computer) then do (Set TempGroup = (Units owned by (Player((Integer A))))) else do (Do nothing)
If (SaveUsActive Equal to (==) 0) then do (Set TempLoc = (Random point in (Playable map area))) else do (Set TempLoc = (Center of Jail <gen>))
If (((Player((Integer A))) controller) Equal to (==) Computer) then do (Unit Group - Order TempGroup to Move To TempLoc) else do (Do nothing)
Unit Group - Remove all units from TempGroup
Point - Remove TempLoc
well anyway it doesn't show that ? for point(and etc. but you get the idea), it shows a blue box which if i remember correctly i haven't seen before in the editor, or else i just haven't seen it often. check out the kodo tag map or mine for yourself if you want to see it.

edit: i have now figured out that lately all my crashing was from me making bad spell triggers. i'm not sure if some of the crashing is from custom text removing locations/unit groups or not but maybe not.
__________________

Last edited by SanKakU; 11-27-2008 at 01:13 AM..
SanKakU is offline   Reply With Quote
Old 12-30-2008, 08:51 AM   #476 (permalink)
 
RoboHippo's Avatar

Fear my 5 rep!
 
Join Date: Mar 2008
Posts: 47

RoboHippo has little to show at this moment (5)


Information Quick Tip!

You can save yourself some trigger work with dummies by setting their health regeneration to a negative value.

The easiest way is to set their health to the number of seconds that they'll need to exist for, and setting the regeneration to -1.

For 2 seconds; Health = 2, Regen = -1
For 1 second: Health = 1, Regen = -1
For 1 1/2 seconds: Health = 3, Regen = -2
For 1/2 second: Health = 1, Regen = -2
For 1/4 second: Health = 1, Regen = -4

Notice that each of these is actually a fraction, so life span in seconds = Health/(-1)Regen (provided that regen is negative). Simply convert the desired life span into an improper fraction, and there you go.
__________________
If I helped you, +rep would be nice!

Do you like parties, like in KoToR or NWN? If so, have a look at this:
http://www.hiveworkshop.com/forums/f...ed-rpg-111660/

Last edited by RoboHippo; 12-30-2008 at 12:05 PM..
RoboHippo is offline   Reply With Quote
Old 12-30-2008, 06:28 PM   #477 (permalink)
 
SanKakU's Avatar

The Host of TDHT
 
Join Date: May 2008
Posts: 136

SanKakU has little to show at this moment (7)


hey RoboHippo, that's a good idea, except that i don't know how to set negative health regeneration. even with phoenix, which has -25, you cannot edit the value to be anything less than 0. how do you work around that?
__________________
SanKakU is offline   Reply With Quote
Old 12-30-2008, 07:01 PM   #478 (permalink)
 
RoboHippo's Avatar

Fear my 5 rep!
 
Join Date: Mar 2008
Posts: 47

RoboHippo has little to show at this moment (5)


It's actually quite easy, once you know how. In WE, just go to File > Preferences, and in the General tab check the box that says "Allow negative real values in the object editor". This will stay in effect until you turn it off. Remember, though, that you can murder your computer through misuse of negatives. But as long as it's logical, it should be fine.
__________________
If I helped you, +rep would be nice!

Do you like parties, like in KoToR or NWN? If so, have a look at this:
http://www.hiveworkshop.com/forums/f...ed-rpg-111660/
RoboHippo is offline   Reply With Quote
Old 12-30-2008, 07:11 PM   #479 (permalink)
 
SanKakU's Avatar

The Host of TDHT
 
Join Date: May 2008
Posts: 136

SanKakU has little to show at this moment (7)


oh great! because i was wondering how the hell to adjust my phoenix spell in that fashion!
__________________
SanKakU is offline   Reply With Quote
Old 12-30-2008, 07:33 PM   #480 (permalink)