Posted: Fri Mar 17, 2017 2:27 pm Post subject:
TS triggers for randomizer?
I am making some MP map for TS and was thinking about creating set of triggers, that would act similar to randomizer and when needed it would randomly set one of 4 variables. Is it possible to achieve this logic with few triggers? QUICK_EDIT
There is a random delay event (51). Use 4 events with same time for triggering.
Then whichever fires first, it could disable the remaining 3 triggers. QUICK_EDIT
Thanks for suggestion, but forgot to mention, I need the trigger logic to be repeatable, to pick one of random actions. If first random counter disables other, it would be for one use. Also without turning other counters off, for next round timers would not start from same starting point and granting high probability to shortest triggered timer previous round. The decreasing of random time should erase imbalanced start, but I am afraid that 4 short repeating random timers which constantly setting and clearing variables could make lag to game or sync error. QUICK_EDIT
expand this a bit further
Trigger 1-4 start
One of them fires and disables them all
-do your trigger work here
-when finish enable all 4 trigger again, so they start at the same time
set all 4 trigger to loop
As an example look at my map Tiber or Dantes Desert in DTA, which uses this to spawn meteors on random waypoints. _________________ SHP Artist of Twisted Insurrection: Nod buildings
-when finish enable all 4 trigger again, so they start at the same time
set all 4 trigger to loop
So timers will reset when disabled/enabled? Good to know.
I also got interesting idea of using visceroid in cage behind map border.
Could be more efficient for more random variables, and do not need any random timers multiplied by variables. Setting to special house can prevent AI from auto-firing it, and some tib. to survive ion storms.
So timers will reset when disabled/enabled? Good to know.
correct.
You should test this, though I'm pretty sure Visceroids don't move outside the playable map. _________________ SHP Artist of Twisted Insurrection: Nod buildings
You should test this, though I'm pretty sure Visceroids don't move outside the playable map.
Units moving to waypoint (like train) or aircraft attacking near border with overrun type leaves and come back without problems, of course unless touching red line, the real end of map.
Tested, working nice,visceroid is triggering celltags with "Entered by" event. QUICK_EDIT
That visceroid cage is a pretty clever idea. It's also preferable in multiplayer maps, where (AFAIK) actual random trigger events can cause sync loss. _________________
indeed, and this also reduces the amount of trigger work.
Though i would have expected the random movement to be disabled outside the map, since any unit moving outside the map and coming to a stop there instantly vanishes (like any unit scripted to leave the map and not come back again. e.g. a train with a waypoint outside the map simply vanishes when it reaches that waypoint) _________________ SHP Artist of Twisted Insurrection: Nod buildings
Another useful variant is putting civilian in cage, to make much longer switch (just guesstimate) approx. 1:30 (compared to visc. with upper pic scheme behind border)
On gif below are showed results. Right spotlight anims belongs to visceroid doing its job outside map and on the left is for civilian in cage.
Also random weight probability of certain tags can be tweaked with celltag position in cage (closer to center grants higher weight)
Though i would have expected the random movement to be disabled outside the map, since any unit moving outside the map and coming to a stop there instantly vanishes (like any unit scripted to leave the map and not come back again. e.g. a train with a waypoint outside the map simply vanishes when it reaches that waypoint)
It doesn't vanish - as in, it doesn't get deleted from the map. It simply does not get rendered beyond the border. Trains are somehow special in that their scripts break if a waypoint exists outside the map border, but for other units it works. For example in TI, Epsilon City a GT Humvee does this. _________________
Some info updates after running few tests and observations:
The civilian variant showed above seems to be not functional outside map border, looks like random movement logic is not the same like for visceroids. Civilian's scatter action is frozen outside, but visceroid's special movement allows it's movement even behind border (maybe because of broken map's special flag option that spawns random visceroids and let it enter map through border)
Visceroid's house can be also set to Neutral. I was afraid that game's new exe hack that let units autofire armed neutral units would attract AI and target them, but ignores it outside map.
Some tiberium patch in cage is necessary for stormy maps, to heal visceroid if it is hit by lightning. I have run some tests and lightnings indeed strikes even outside map's borders. QUICK_EDIT
Why not simply create a new dummy unit in the map?
[VehicleTypes]
Dummy01=RNDMTRIG
[RNDMTRIG]
Name=random trigger dummy unit
Image=VISLRG
Immune=yes ;make it invincible
LegalTarget=no ;prevent auto-attacking by AI and player units
LargeVisceroid=yes
;and the other visceroid unit keys copied here
by setting Speed=3 or lower, you can this way also change the rate at which the random events are fired, since the unit moves a lot slower than the normal visceroid. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Why not simply create a dummy unit in the map?
[RNDMTRIG]
Name=random trigger dummy unit
Image=VISLRG
Immune=yes ;make it invincible
LegalTarget=no ;prevent auto-attacking by AI and player units
LargeVisceroid=yes
;and the other visceroid unit keys copied here
I am not sure, but I think that only one vehicle can have LargeVisceroid=yes tag, probably breaks normal visceroids and disables baby visc. merging into adult. Or are these tags from [General] ini section?
LargeVisceroid=VISC_LRG
SmallVisceroid=VISC_SML
Yes, if multiple units can have LargeVisceroid=yes, than can be this simpler solution for mod, but for nonmod mp maps, adding completely new units is not possible, only replacing one that are unused. (like unloaded harvester, game switches these voxels when harvester unloading, but still uses ini tags under [HARV] and [HORV] are ignored)
LKO wrote:
by setting Speed=3 or lower, you can this way also change the rate at which the random events are fired, since the unit moves a lot slower than the normal visceroid.
Visceroids by default use wheel type movement, setting rough ground makes also great impact on speed QUICK_EDIT
You can add perfectly fine completely new units to any map (as long as they share an existing graphic, since you can't do art.ini code in a map. But anything possible in rules.ini is also possible to do in a map).
Just add the name of the list and the entry for the new unit
[VehicleTypes]
anyIndexString=NEWUNITID ;anyIndexString shouldn't use a number, as this can cause conflicts with units in rules.ini using that index already. So best use a random string with letters and numbers.
Multiple units using SmallVisceroid or LargeVisceroid work perfectly fine.
The global keys define already which visceroids can merge into which other visceroid.
The vehicletype keys SmallVisceroid and LargeVisceroid have nothing to do with the merging logic. These 2 keys are only responsible for the random movement.
No clue however why WW implemented 2 of them though, since they don't seem to have any difference. I can only imagine that SmallVisceroid doesn't works well with a weapon, thus the other key LargeVisceroid, but i never tested this. Might be also from an early dev state, where the global keys didn't exist yet. _________________ SHP Artist of Twisted Insurrection: Nod buildings
You can add perfectly fine completely new units to any map (as long as they share an existing graphic But anything possible in rules.ini is also possible to do in a map).
anyIndexString shouldn't use a number, as this can cause conflicts with units in rules.ini using that index already. So best use a random string with letters and numbers.
Great, Thanks! I didn't know that
Also giving unit string for index instead of id. Smart.
LKO wrote:
But anything possible in rules.ini is also possible to do in a map).
Just add the name of the list and the entry for the new unit
Slightly offtopic: Tried to change color for Neutral house for specific MP map, but no luck, inserting changed values in map
Tried adding:
[Colors]
Grey=(changed values)
or
[Neutral]
Color=LightSky
Not sure of map loads only specific sections of rules.ini or Neutral house is half hardcoded. QUICK_EDIT
Those colors are ignored as the color for Neutral and Special is hardcoded to be LightGrey.
Changing colors for houses works in singleplayer maps only.
So your only chance would be to change LightGrey.
But keep in mind that this color is also used for interface stuff like text on the sidemenu.
Those colors are ignored as the color for Neutral and Special is hardcoded to be LightGrey.
Changing colors for houses works in singleplayer maps only.
So your only chance would be to change LightGrey.
But keep in mind that this color is also used for interface stuff like text on the sidemenu.
Thanks for info, looks like colors can't be edited/expanded using map in any way.
looks like colors can't be edited/expanded using map in any way.
As I remember, only the hardcoded colors cannot be changed in the maps,
as they are read from rules.ini when the game engine starts, like the MP
player colors or others used by the engine like green text used on the loading
screen etc. Remaining colors should be changeable in maps. But more than
that you could always add new colors in maps like
[Colors]
MyColor1=x,x,x
MyColor2=y,y,y
Then you could use the new colors in map itself like to change the color of
tiberium. But you can't change LightGrey which is hardcoded for Civilian
sides. QUICK_EDIT
As I remember, only the hardcoded colors cannot be changed in the maps,
as they are read from rules.ini when the game engine starts, like the MP
player colors or others used by the engine like green text used on the loading
screen etc. Remaining colors should be changeable in maps. But more than
that you could always add new colors in maps like
[Colors]
MyColor1=x,x,x
MyColor2=y,y,y
Then you could use the new colors in map itself like to change the color of
tiberium. But you can't change LightGrey which is hardcoded for Civilian
sides.
I have tested only colors for houses (player's and neutral).
I have tried to change many colors (hardcoded,nonhardcoded) like: LightGrey, White, Orange, Purple, Magenta under [Colors]
But game seems doesn't overwrite Colors section, possibly because usage colors in other hardcoded things, not only to remap.
Edit: tested also new color for tib. in map, but no change in game
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum