wisp wheel

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Serenity09
Newcomer
Posts: 3
Joined: June 18th, 2009, 2:21 am

wisp wheel

Post by Serenity09 »

Hi I'd greatly appreciate help creating either a GUI or jass system to create (and ideally destroy) wisp wheels. A wisp wheel is basically a bunch of units that rotate radially around a point. Usually its some amount of wisps going in circles around the same point. One of the tricky parts is that there are different levels of these wisps which must be moving in conjuction with the inner level. So for a 3 level wisp wheel that has 5 wisps in each level, there would be the first level that is a distance r from the center point that contains 5 wisps that are evenly spaced. In the second level there are 5 more wisps a distance r from the first level moving much faster than the first level in order to stay in sync. Third level follows the same pattern.
The parameters for this method/function include the number of wisps per level, the number of levels, the distance between each level, and the speed of the wisps. Kattana used to have a system for doing this - one that was pretty completely destroyed by the patch. I don't have the slightest idea how to fix his work, but if anyone does I'd be very grateful. It can be found here: http://www.wc3jass.com/viewtopic.php?t= ... sc&start=0
Where implementing a wisp wheel using Kattana's system was just:
function CreateWispWheel takes unit center, integer spokeId, player owner, integer spokes, integer length, real degreeIncrement, real distanceIncrement, real dpi returns nothing
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: wisp wheel

Post by Ken »

If you wanna use his, just change this:

Code: Select all

function H2I takes handle h returns integer
    return h
    return 0
endfunction

To:

Code: Select all

function H2H takes handle h returns handle
    return h
endfunction
function H2I takes handle h returns integer
    call H2H(h)
    return 0
endfunction
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that
Serenity09
Newcomer
Posts: 3
Joined: June 18th, 2009, 2:21 am

Re: wisp wheel

Post by Serenity09 »

Aha, thats much easier, thankyou very much and I will give ye my first born child :D
Serenity09
Newcomer
Posts: 3
Joined: June 18th, 2009, 2:21 am

Re: wisp wheel

Post by Serenity09 »

With the unfortunate downside that the code still won't compile. It grabs an error here:

Code: Select all

function GetHandleUnit takes handle subject, string name returns unit
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction  //Error here

with the error coming up on endfunction for being invalid type for specified operator (there are a bunch more errors but I'm hoping the majority of them go poof)

Also tyvm once again for anyone willing to help.

Also, because it might help, here is the full code:
Spoiler:

Code: Select all

// ===========================
function H2H takes handle h returns handle
    return h
endfunction
function H2I takes handle h returns integer
    call H2H(h)
    return 0
endfunction

// ===========================
function LocalVars takes nothing returns gamecache
    // Replace InitGameCache("jasslocalvars.w3v") with a global variable!!
    return InitGameCache("jasslocalvars.w3v")
endfunction

function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
    endif
endfunction

function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
    if value==false then
        call FlushStoredBoolean(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleString takes handle subject, string name, string value returns nothing
    if value==null then
        call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
    return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
    return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction

function GetHandleUnit takes handle subject, string name returns unit
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
User avatar
Risen
Forum Staff
Posts: 811
Joined: January 1st, 2008, 12:58 am

Re: wisp wheel

Post by Risen »

Instead of abusing the bug, just try GetHandleId()
Image
Wanna learn to hack maps? --> Guide
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: wisp wheel

Post by Ken »

Oh, nope, that won't help... Each of the functions like that use the old return bug such as returning an int for a unit. First add this to the top:

Code: Select all

function I2I takes integer i returns integer
    return i
endfunction
Then change each of the functions like the one you posted to:

Code: Select all

function GetHandleUnit takes handle subject, string name returns unit
    call I2I(GetStoredInteger(LocalVars(), I2S(H2I(subject)), name))
    return null
endfunction
Once you do that, it should work like a charm maybe.
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that