Staredit Network > Forums > SC1 Mapping Tools > Topic: Oreo Triggers
Oreo Triggers
Jun 2 2012, 9:22 am
By: Kaias
Pages: < 1 « 2 3 4 5 >
 

Sep 23 2012, 10:18 pm samsizzle Post #61




This should work fine...

Quote
// 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.

Sep 24 2012, 7:11 am Kaias Post #62



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.

Sep 24 2012, 11:30 pm Kaias Post #63



Alright, latest version: http://www.mediafire.com/?krvtr5chehnigyh
  • Fixes a mint bug where a Dark Swarm and Nuclear missiles were becoming Cocoons and Tank turret type 1s.
  • Lets actions accept deathcounters for amounts again (it managed to slip out of the previous version, which caused Samsizzle's problem above).
  • Conditions/Actions can now accept UnitGroup objects for unit parameters.
  • Added ->isHome(), to UnitGroup, which simply checks if the declared Unit&Player are at the declared Location.




None.

Nov 3 2012, 3:35 pm swb4u1 Post #64



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.

Nov 8 2012, 10:56 am Kaias Post #65



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.

Apr 11 2013, 2:38 am Lethal_Illusion Post #66



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:
OreoGridTests.scx
Hits: 6 Size: 313.65kb



None.

Apr 11 2013, 8:37 am Oh_Man Post #67

Find Me On Discord (Brood War UMS Community & Staredit Network)

Pressing those buttons did nothing for me?




Apr 11 2013, 10:09 am Kaias Post #68



Quote from Oh_Man
Pressing those buttons did nothing for me?
He got it wrong. Its Q W E and R that activate the spells.



None.

Sep 4 2013, 8:30 pm Jack Post #69

>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:
Quote
// 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?
Code
$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."

Sep 5 2013, 7:23 am Kaias Post #70



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.

Sep 5 2013, 1:57 pm Cinolt Post #71



SFileOpenArchive tried to open an archive (map) but failed. Make sure you specified the correct path, and make sure it's readable.



None.

Sep 5 2013, 3:02 pm jjf28 Post #72

Cartography Artisan

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 - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Sep 5 2013, 8:55 pm Jack Post #73

>be faceless void >mfw I have no face

Quote from name:yoonkwun
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."

Sep 6 2013, 2:01 am Kaias Post #74



Update (1.0.1)
http://www.mediafire.com/download/ycdjj5qn6s6k8x6/Oreo_Triggers_1.0.1.rar

Summary:
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.

Dec 20 2013, 7:58 pm Sacrieur Post #75

Still Napping

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.

Dec 24 2013, 5:23 am Kaias Post #76



Quote from Sacrieur
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.

Jun 30 2014, 3:17 pm Sacrieur Post #77

Still Napping

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.

Dec 25 2015, 11:14 pm Zoan Post #78

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?



\:rip\:ooooo\:wob\:ooooo \:angel\: ooooo\:wob\:ooooo\:rip\:

Dec 26 2015, 1:15 pm NudeRaider Post #79

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(




Dec 26 2015, 11:36 pm Kaias Post #80



Quote from 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?

With and without conditions:


$player->justonce(
actions
);

$player->_if( conditions )->then_justonce(
actions
);




None.

Options
Pages: < 1 « 2 3 4 5 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: Roy, Wilke801, NudeRaider, Oh_Man