• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Cook System [v1.1]

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
MUI: Yes
vJASS: Yes

To use this spell you need the vJNGP

spells_2548_screenshot.jpg



Cook System

A system I made for my map some time ago, I decided to release it now. Cooks only meat but I guess it could be useful for some map.

Versions
v1.1
- Removed and added some globals
- Replaced multiple-unit fire pits to triggered color changing fire pits
- Optimized script
- Merged triggers

v1.0 - System uploaded
Keywords:
cook, system, survival, meat, cooking, burn, normal, perfect, monster, hunter, raw, food
Contents

Cook System (Map)

Reviews
19:48, 26th Oct 2009 TriggerHappy187: Decent system, horribly coded. Make all your globals private, use some indenting too -_- I'm not going to approve a vJass system with TSA's... I mean c'mon. Reject until updated.

Moderator

M

Moderator

19:48, 26th Oct 2009
TriggerHappy187:

Decent system, horribly coded.

Make all your globals private, use some indenting too -_-
I'm not going to approve a vJass system with TSA's... I mean c'mon.

Reject until updated.
 
Level 17
Joined
Mar 17, 2009
Messages
1,349
Funny yet very nice idea :p

Umm, how to improve:

Better initialization which is completely leakless and uses local trigger:
JASS:
function AntiLeak takes nothing returns boolean
    return true
endfunction

function InitTrig_Cook_System takes nothing returns nothing
    local trigger t = CreateTrigger()
    local filterfunc f = Filter(function AntiLeak)
    local integer index
    set index = 0
    loop
        call TriggerRegisterPlayerUnitEvent(t, Player(index), EVENT_PLAYER_UNIT_SPELL_CHANNEL, f)

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
    call TriggerAddCondition(t, Condition( function Trig_Cook_System_Conditions ) )
    call TriggerAddAction(t, function Trig_Cook_System_Actions )
    call DestroyFilter(f)
    set f = null
    set t = null
endfunction

Make the two triggers into one, it's Jass so it's easily done...
 
Level 15
Joined
Jan 31, 2007
Messages
502
Umm, how to improve:

Better initialization which is completely leakless and uses local trigger:

JASS:
function AntiLeak takes nothing returns boolean
    return true
endfunction

function InitTrig_Cook_System takes nothing returns nothing
    local trigger t = CreateTrigger()
    local filterfunc f = Filter(function AntiLeak)
    local integer index
    set index = 0
    loop
        call TriggerRegisterPlayerUnitEvent(t, Player(index), EVENT_PLAYER_UNIT_SPELL_CHANNEL, f)

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
    call TriggerAddCondition(t, Condition( function Trig_Cook_System_Conditions ) )
    call TriggerAddAction(t, function Trig_Cook_System_Actions )
    call DestroyFilter(f)
    set f = null
    set t = null
endfunction

Make the two triggers into one, it's Jass so it's easily done...

Wow, now im interested ;D can you tell me how to inline a Filter(function AntiLeak)? i dont know how this could be done x]

Shendoo2 said:
Isn't that against the rules to a spell that u need a 3rd party program now? Part of the new rules?
third party program? do you mean Jass New Gen Pack?
lol, take a guess what vJass is

Heres my impression of yor Spell:

- Please reame those ugly functions like Trig_Cook_System_Actions , you dont need those stupid Blizzard prefixes. Also rename the Init and initialize it via scope scope CookSystem initializer Init


- What should this do ? call TriggerSleepAction(0)


- Use timers. Using waits isnt the best solution.. constant real Speed=0 //* Lower value gives faster speed e.g. heres one of the disadvantages.. "lower value".. x] negative wait? you cant speed it up faster than 0.27 seconds

- You should move the |cff80ccff into your global block for modification

- Why do you use so many different units for the fire place? one for each color? wtf - change its color per native SetUnitVertexColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing


- Your Stop Coock units got the locust ability, if you once deselect it during the cooccking its impossible to stop it

ect
 
Wow, now im interested ;D can you tell me how to inline a Filter(function AntiLeak)? i dont know how this could be done x]


third party program? do you mean Jass New Gen Pack?
lol, take a guess what vJass is

Heres my impression of yor Spell:

- Please reame those ugly functions like Trig_Cook_System_Actions , you dont need those stupid Blizzard prefixes. Also rename the Init and initialize it via scope scope CookSystem initializer Init


- What should this do ? call TriggerSleepAction(0)


- Use timers. Using waits isnt the best solution.. constant real Speed=0 //* Lower value gives faster speed e.g. heres one of the disadvantages.. "lower value".. x] negative wait? you cant speed it up faster than 0.27 seconds

- You should move the |cff80ccff into your global block for modification

- Why do you use so many different units for the fire place? one for each color? wtf - change its color per native SetUnitVertexColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing


- Your Stop Coock units got the locust ability, if you once deselect it during the cooccking its impossible to stop it

ect

I'll fix the filter leak, yeah the disadvantage is the speed can't go lower than 0.27second but this is for a simple one. I just added some globals and so on to release this since I made this for my project, one that uses timer needs to be a different coding if I really want to make one. About the stop cook unit, it has locust, yes, that's why I made it as a worker, press "`" and it's selected. And about the set vertex color, -.- silly me I didn't thought of that, will update the spell right away.

Edit: Updated System.
 
Last edited:
Level 9
Joined
Aug 1, 2008
Messages
453
Do u think you could include another food example, so i would know how to do 2 different foods, with different chances to be cooked, half cooked, burnt, ect.

- Would u just copy the trigger and change the info to make another food example?
 
Do u think you could include another food example, so i would know how to do 2 different foods, with different chances to be cooked, half cooked, burnt, ect.

- Would u just copy the trigger and change the info to make another food example?

An easy way to the it is to duplicate the triggers, but it's not efficient. I can't code it in one trigger since I won't know what you want to cook. Anyway this system only supports up to 4 items. You can change the item in the item editor.
 
Level 6
Joined
Jul 27, 2008
Messages
132
i have idea!
Can you add more sistem?
=======================================================|
My Idea|||||| wtf english X |
=======================================================|
Meat Can be cooked again...
Like this Raw meat has been cooked and be normal meat(the meat allready droped)...
and it's should can be cooked again to be pf meat ...
haha lol bad english :X
=======================================================
 
i have idea!
Can you add more sistem?
=======================================================|
My Idea|||||| wtf english X |
=======================================================|
Meat Can be cooked again...
Like this Raw meat has been cooked and be normal meat(the meat allready droped)...
and it's should can be cooked again to be pf meat ...
haha lol bad english :X
=======================================================

But it would ruin the system I guess, people could possibly 100% get perfect meat if it is so. But if there's more than 2 person who do think that making it like what you said is good then I'll do it.
 
Level 6
Joined
Jul 27, 2008
Messages
132
But it would ruin the system I guess, people could possibly 100% get perfect meat if it is so. But if there's more than 2 person who do think that making it like what you said is good then I'll do it.
========
Feed Back
========
No...
In real world we can Cook Cooked meat or anything at all times/many times :)
:cgrin: :witch_doc_sad:
=======
Off Topic
=======
and that one not Chicken it's Swine...
 
Why when i edit it does it just goes to the warcraft 3 menu not opening and running the game? I installed the JassNewGen v5d, and i used its WE. I have it extracted to a folder on my desktop...

There's a slight disadvantage in vJassNewGen that is you have to save the map manually [ctrl+s] and test the map after saving [ctrl+9]. If this doesn't work, means you have some problem with the vJassNewGen.
 
Top