This should work fine...
// WARNING! 2 temp switches are unkilled!
// WARNING! 8 temp dcs are unkilled!
Temp Switches and DCs are so fucking annoying.
EDIT: Changing the declaration of $randspawn to $players instead of CP, changes nothing.
Post has been edited 1 time(s), last time on Sep 23 2012, 10:26 pm by samsizzle.
None.
It could be that you're using a math function that doesn't kill its temp dcs/switches, and that it isn't a fault of your own (or having to do with randspawn or havespawn at all). If that's the case, then I just need to fix the culprit function. I'll look at your code tomorrow.
By the way, killing temps produces an clearing action, not a trigger, so you have to put it in a trigger if you want the values to be cleared.
None.
This is incredible.
I do love you.
Edit: Could you add a [deathcounter] function which can contain memory value ?
I mean the value of [offset 6284B8] is 350 and I want to put this value in deathcount.
Post has been edited 1 time(s), last time on Nov 3 2012, 6:00 pm by Roy. Reason: Edit your old posts instead of double-posting
None.
Update (0.9.6)http://www.mediafire.com/?g7gg4is0zynm69k- Added deathcounter method ->loadAddressValue($address, $min, $max)
- Added UnitGroup ->enters($location) and ->exits($location).
- Deathcounters used in strings now display their values and can now be enumerated. As shown:
A minimum can be defined as well. (e.g. $dc->Min = 10).
- Added DisplayAlt($text) which displays text in an alternate font (as seen in SCCharSwap).
- Oreo now checks for updates
- Fixed a bug where prepended triggers couldn't use Minted locations
- Duplicate (non-player specific) Events now use the same map resources
- Locations return their names when used as strings
- Minor performance increases
Try to keep strings short if you're using deathcounters in Display. One string is created per possible DC value, so break at the newline if possible. You can use multiple DCs in the same Display, but this is obviously a unwise. Let me know if I messed up the formula on ->loadAddressValue, swb4u1.
Edit 11/16/12: Updated the download link to include a fix that makes it compile faster in many circumstances.
Post has been edited 4 time(s), last time on Nov 16 2012, 11:01 pm by Kaias.
None.
I just tried out an old test map that I thought it was pretty neat, so I decided to post it.
This was mostly a test to see how easy it'd be to make a few basic spells with Oreo. It turns out it was surprisingly easy.
It's 20x12 so play another game before playing this.
It has EUDs (sorry Macs).
Z = slow fireball
X = defensive wall
C = fast fireball
V = lobbing spell
Attachments:
None.
Find Me On Discord (Brood War UMS Community & Staredit Network)
Pressing those buttons did nothing for me?
Pressing those buttons did nothing for me?
He got it wrong. Its Q W E and R that activate the spells.
None.
>be faceless void >mfw I have no face
I reinstalled Oreo and WAMP on my new PC and made an empty terrain map with start locations, and tried to use Mint to compile directly into a new map. Here's the error I get:
// Compile Complete
// Execution time: 0.006883
// Triggers: 4
// Switches used: 0 / 255
// Deathcounter slots used: 0 / 448
// Minting Complete
// Execution time: 0.201943
// Assertion failed: SFileOpenArchive(av[1],0,0,&mpq), file scmc.cpp, line 98
//
// This application has requested the Runtime to terminate it in an unusual way.
// Please contact the application's support team for more information.
The map is created but there are no triggers in it.
Why does this not work?
$Player1 = new Player("Player 1");
$currentArmour = new Deathcounter(100);
$armourTimer = new Deathcounter(36);
$hero = new UnitGroup("Protoss Zealot", P1, Anywhere);
$Player1->justOnce(
$currentArmour->setTo(10)
);
$Player1->_if($armourTimer->AtLeast(1)) ->then
(
$armourTimer->subtract(1)
);
for($i = 0; $i < 100; $i++) {
$Player1->_if( $armourTimer->exactly(0) )->then
(
_if($currentArmour->exactly($i))->then
(
$hero->setShield($i)
)
);
}
$Player1->_if($armourTimer->exactly(0)) ->then
(
$armourTimer->setTo(36)
);
Post has been edited 1 time(s), last time on Sep 4 2013, 9:14 pm by Jack.
Red classic.
"In short, their absurdities are so extreme that it is painful even to quote them."
I ran your code and had no trouble. You could try using the
version of Oreo I'm working with, but it looks like an issue with Mint (which yoonkwun developed). If the problem persists, I'll try to talk to him about it.
By the way, there's a simpler way to do that:
It will automatically create the 100 triggers it needs to to set the shield to the deathcounter value, based on the deathcounter's max of 100.
None.
SFileOpenArchive tried to open an archive (map) but failed. Make sure you specified the correct path, and make sure it's readable.
None.
Sometimes a map will become corrupt or inconsistent with its extension (ex: a chk file with a .scx extension) and SCMD will still open it (while sfmpq will not), SCMD sometimes causes such errors, worth checking if you could post that map
TheNitesWhoSay - Clan Aura -
githubReached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.
>be faceless void >mfw I have no face
SFileOpenArchive tried to open an archive (map) but failed. Make sure you specified the correct path, and make sure it's readable.
The BroodWar folder has no space between Brood and War, but I had a space in my path >.> thanks for the help guys!
Kaias, that's the first thing I tried but it didn't work in the version of Oreo I had. The version you uploaded worked perfectly though
Do you have any plugin for PHPStorm that has autocomplete for Oreo functions?
Post has been edited 2 time(s), last time on Sep 5 2013, 9:58 pm by Jack.
Red classic.
"In short, their absurdities are so extreme that it is painful even to quote them."
Update (1.0.1)http://www.mediafire.com/download/ycdjj5qn6s6k8x6/Oreo_Triggers_1.0.1.rarSummary:
It's been almost a year since I posted any of my updates, so I figured it's about time.
Bug fixes, a few new functions, most Actions can now take a Deathcounter as an argument in place of an integer, some internal restructuring, and slightly improved error handling.
General- Most (all? don't remember) Actions can now take a deathcounter in place of an integer (e.g. Give(P1, "Terran Marine", $dc, P2, Anywhere) )
- Added force casting (->F1, ->F2, ->F3, ->F4) to TempDCs, UnitGroups and IndexedUnits (e.g. $hydras->F1->kill() )
- Added ->release() as an alias for ->kill() for TempDC and TempSwitch classes
- Added $unitdata array to data files, for easy access to units' id, dimensions, and top speed
- Added SetClassFolder("folderpath") for telling Oreo where to look for autoloading your own Classes
- Added CreateCondition($reserveSwitch, $conditional, $actionstext) function (for creating custom Condition functions)
- Improved error handling (in some instances)
- Fixed an issue with prepended triggers for non-mint Oreo
- Fixed some issues with php 5.3 compatibility
- General bug fixes, and minor improvements
Deathcounter Class- Added ->subtractDel($var) and ->addDel($var) methods (they subtract/add the passed in dc from the calling dc, but don't restore it, leaving the passed dc at 0)
- Added ->min($min) and ->range($min, $max) methods to set the Deathcounter's minimum and maximum values (->max() already existed. Oreo uses the Min and Max values to be more efficient wherever it can be)
- Added ->loadPlayerMemory($player, $min, $max) for easily setting a deathcounter to an EPD value
- Fixed a bug in the ->productOf($var1, $var2) method (in certain cases used the wrong max values for the DCs)
- Using the deathcounter as a plain condition will translate to being ->atLeast(1) (e.g. _if($deathcounter) will translate to _if($deathcounter->atLeast(1))
IndexedUnit Class- Added ->isUnitType($unit) Condition to IndexedUnit (Condition that checks if the index is the specified unit type (marine, zergling, etc))
- Added ->checkSpecificTargetIDs($dc, $switch, $array) and ->getSpecificTargetIDs($dc, $array) methods (these are highly specialized, you probably won't use them)
Location Class- Added ->explode($player = P8) Action (creates/kills a Wraith (owned by $player) at the location). You have to be careful though, it kills ALL Terran Wraiths on the map for $player, since I can't be certain that the wraith won't be created outside the location (if the location is occupied by other units)
UnitGroup Class- Added ->enableDoodadState() and ->disableDoodadState() Action methods
None.
The header you need to put into the PHP file (<?php require_once('Oreos/initialize.php')
;), uses Oreos as the folder name. However, the unzipped folder for the latest version is Oreo Triggers 1.x.x, so you might want to add an additional step telling people to rename the folder to "Oreos" to clear up this discrepancy
None.
The header you need to put into the PHP file (<?php require_once('Oreos/initialize.php')
;), uses Oreos as the folder name. However, the unzipped folder for the latest version is Oreo Triggers 1.x.x, so you might want to add an additional step telling people to rename the folder to "Oreos" to clear up this discrepancy
Nice catch.
I saw your mention of Oreo in the shoutbox (talking to jjf). The functions in Oreo aren't optimized for trigger or map size efficiency, but rather the lowest amount of in-game stress (because that's all Lethal or I ever care about). Take quaternary countoffs, for instance- they take half as many triggers as binary countoffs, but each trigger is evaluated three times as often. This means they produce 50% more in-game trigger lag than their binary counterparts. That doesn't necessarily mean these functions are the most lag efficient they can be, of course.
If anyone needs assistance with Oreo (setting it up or using it), I'm perfectly willing to help. The documentation is outdated though, which is why I always recommend an IDE with good code-hinting (like Phpstorm).
Post has been edited 1 time(s), last time on Dec 24 2013, 6:11 pm by Kaias.
None.
Using the latest version of Oreo.
For some reason it's telling me that I can't create a new DC because I don't have any free ones. Also a problem with switches. When I create a new PermSwitch I get an output of Switch("", set); instead of Switch("Switch1", set);.
None.
Math + Physics + StarCraft = Zoan
Does anyone know if it's possible to have a "just once" type of trigger that only executes when certain conditions are met?
i.e. is it possible to make a trigger with more conditions than just the "always" condition and also without "preserve trigger" in the actions?
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
I don't know about the preserve trigger, but conditions would look like this:
$P1->_if( $spawntimer->exactly(0) )->then(
Does anyone know if it's possible to have a "just once" type of trigger that only executes when certain conditions are met?
i.e. is it possible to make a trigger with more conditions than just the "always" condition and also without "preserve trigger" in the actions?
With and without conditions:
$player->justonce(
actions
);
$player->_if( conditions )->then_justonce(
actions
);
None.