|
|
|
|
| JASS Resources Find JASS code snippets and functions here or write your own and post it on the Submissions sub-forum. |
 |
|
03-31-2012, 12:15 PM
|
#106 (permalink)
|
|
User
Join Date: May 2009
Posts: 495
|
yay i found a test map!
gonna test it soon... then by the time I understand it.. I'll use TT for the sake of alienation
*kiddin
btw.. is CTL(the deprecated one) and CTM have the same implementation?
|
|
|
03-31-2012, 07:28 PM
|
#107 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
CTM doesn't require a timeout constant. If you are just using .031250000, use the third module in this.
|
|
|
04-02-2012, 08:13 AM
|
#108 (permalink)
|
|
A bee of TheHive
Join Date: Dec 2010
Posts: 94
|
Just kinda confused here. Both CTT and CTTC are for constant timeouts. On what circumstances would I choose CTT over CTTC or the latter?
__________________
|
|
|
04-02-2012, 04:55 PM
|
#109 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
CTTC is a constant timeout that will always merge, meaning one timer node for all timers. CTC is a constant timeout that won't always merge.
CTC might use a timeout of 2 or 5
CTTC might use a timeout of .03125 or .1
|
|
|
04-22-2012, 09:09 AM
|
#110 (permalink)
|
|
User
Join Date: May 2009
Posts: 495
|
I'm currently making some sort of spell apparently.. i can't seem to let it work with either CTM or CTTC.. and CTTC is worst 'cause the first cast will stop (if there are no enumerated units) and gives me a fatal error on second simultaneous cast (if there are any enumerated units)
here's the code lol
Jass:
scope MetalShot
private struct MetalShot
unit caster
unit array arrows[3]
player owner
integer lvl
real array cos[3]
real array sin[3]
real dmg
real dist
private static constant real TIMEOUT = 0.031250000
private static hashtable ht = InitHashtable()
private group tmpGroup = bj_lastCreatedGroup
implement CTT
local unit f
local integer i
local real x
local real y
implement CTTExpire
if dist > 0 then
set i = 0
loop
exitwhen i >= 3
set x = GetUnitX(this.arrows[i]) + 21 * this.cos[i]
set y = GetUnitY(this.arrows[i]) + 21 * this.sin[i]
call SetUnitX(this.arrows[i],x)
call SetUnitY(this.arrows[i],y)
call GroupEnumUnitsInRange(tmpGroup,x,y,250,null)
loop
set f = FirstOfGroup(tmpGroup)
exitwhen f == null
call GroupRemoveUnit(tmpGroup,f)
if IsUnitEnemy(f,this.owner) and not IsUnitType(f,UNIT_TYPE_STRUCTURE) and UnitAlive(f) and not HaveSavedBoolean(ht,this,GetHandleId(f)) then
call UnitDamageTarget(this.caster,f,this.dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
call SaveBoolean(ht,this,GetHandleId(f),true)
endif
endloop
set i = i + 1
endloop
set dist = dist - 21
else
set i = 0
loop
exitwhen i >= 3
call RemoveUnit(this.arrows[i])
set i = i + 1
endloop
call FlushChildHashtable(ht,this)
call this.destroy()
endif
implement CTTNull
set f = null
implement CTTEnd
static method start takes nothing returns boolean
local thistype this = thistype.create()
local integer i = 0
local real angle
set this.caster = GetTriggerUnit()
set this.owner = GetTriggerPlayer()
set this.lvl = GetUnitAbilityLevel(this.caster,'A009')
set this.dist = 700
set this.dmg = 1000
set angle = GetUnitFacing(this.caster)-45
loop
exitwhen i >= 3
set this.arrows[i] = CreateUnit(Player(15),'h006',GetUnitX(this.caster),GetUnitY(this.caster),angle)
set this.cos[i] = Cos(angle*bj_DEGTORAD)
set this.sin[i] = Sin(angle*bj_DEGTORAD)
set angle = angle + 45
set i = i + 1
endloop
return false
endmethod
static method onInit takes nothing returns nothing
call RegisterSpellEffectEvent('A009',function thistype.start)
endmethod
endstruct
endscope
To reproduce it, you must cast the spell simultaneously... or while the first cast is still in effect
pretty bad lol
|
|
|
04-22-2012, 09:17 AM
|
#111 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
And this be why
private struct MetalShot
it has to extend array
whenever you use one of my modules, just assume that the struct has to extend array or it won't work =P.
|
|
|
04-22-2012, 09:21 AM
|
#112 (permalink)
|
|
User
Join Date: May 2009
Posts: 495
|
lol that stopped me from using arrays..
lemme test
EDIT:
Yey it's working magnificently!! But i still use arrays >:D
Also, please update the docs... it didn't say that it is required that I must extend array
only the examples said it... o.o
ohh well
Quote:
Nes Nes is awesome
By Nes Nes
Nes Nes is so awesome
That I wrote this awesome poem
How awesome
|
EDIT 2:
Perhaps you may update your Recycle library or this library.. struct Timer is being redeclared o.o
Last edited by jim7777; 04-22-2012 at 10:05 AM.
|
|
|
04-23-2012, 02:23 AM
|
#113 (permalink)
|
|
SSJ99999 Pinoy!
Join Date: Mar 2009
Posts: 4,474
|
Quote:
|
CTC might use a timeout of 2 or 5
|
Nes, you should indicate in the documentation that a particular timer loop cannot run under 'X real', coz I've tested CTC and it cant run under 0.4, and CTTC cant run above 0.3...
Maybe it's an option, coz I've tested it and worked just fine :)...
__________________
My Resources:
My Maps
My Systems/Spells
Your ideas tend to result in unnecessary violence so shut the F*** up!
|
|
|
04-23-2012, 02:51 AM
|
#114 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
mckill2009, they can run at whatever u want... they run based on the settings =P. You should read the documentation, because all of that was stated =).
|
|
|
04-23-2012, 03:51 AM
|
#115 (permalink)
|
|
SSJ99999 Pinoy!
Join Date: Mar 2009
Posts: 4,474
|
you mean they can run based on the module you implemented that is absolutely true, but running a CTT for example under 0.4 cant run...
__________________
My Resources:
My Maps
My Systems/Spells
Your ideas tend to result in unnecessary violence so shut the F*** up!
|
|
|
04-23-2012, 04:46 AM
|
#116 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,986
|
yes it can... again, read the documentation and settings before you start stating that stuff
Jass:
************************************************************************************
*
* SETTINGS
*/
|
|
|
04-23-2012, 06:23 PM
|
#117 (permalink)
|
|
Dance, my puppets, dance!
Join Date: Sep 2009
Posts: 2,367
|
Quote:
Originally Posted by Nestharus
What does this tell you? Using standard timers is smart and better than using TimerUtils >.>, lolz.
|
Haha, thanks for pointing that out. :D
Now I don't feel bad anymore for not using any timer system at all in Gaias Retaliation, but manually handling all timer stuff.
Your system with the increase of speed when using one shot timers sounds neat.
However, there is something about it that will scare away most of the mappers in my oppinion:
It requires total recoding of almost everything as it uses a syntax that is totally different from using ordinary timers and other timer systems (with all the module stuff).
It's not done by replacing one or two lines with a text editor, so the amount of work people would have to invest into changing from like TimerUtils or T32 to this one on higher complexity maps is insane.
Not really your problem, though, just something I wanted to say. Maybe you can do something about it to make a switch between the systems easier? Maybe create a textmacro for compat for this?
Other than that: awesome stuff! I really love that module syntax. Too bad I am to lazy to switch to your system. ;(
... then again, I probably won't use enough timers anyway to get a noticable difference in fps.
|
|
|
04-23-2012, 06:56 PM
|
#118 (permalink)
|
|
Go away.
Resource Moderator
Join Date: Dec 2008
Posts: 5,748
|
The noticeable difference starts at 60-ish timers with average specs :P
|
|
|
04-23-2012, 07:27 PM
|
#119 (permalink)
|
|
Dance, my puppets, dance!
Join Date: Sep 2009
Posts: 2,367
|
Quote:
Originally Posted by Magtheridon96
The noticeable difference starts at 60-ish timers with average specs :P
|
... assuming that there is nothing in the function attached to the timers. ;)
And 60 timers is a lot for me... I don't think I will ever reach that number. ^^
|
|
|
04-23-2012, 08:35 PM
|
#120 (permalink)
|
|
Go away.
Resource Moderator
Join Date: Dec 2008
Posts: 5,748
|
Actually, I got that number from a few tests I did long ago with one of my spells =P
Of course, there was a noticeable difference with 10-20 casts, but the difference was completely noticeable when I did 60+ casts :D
Of course, that's a bit too far-fetched :p
What kind of game would allow you to make 60+ casts? xD
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 02:00 AM.
|