:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Mon May 29, 2017 4:13 am
All times are UTC + 0
 Forum index » Modding Central » Tiberian Sun Editing Forum » Mapping Discussion
TS triggers for randomizer?
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [23 Posts] View previous topic :: View next topic
Author Message
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Fri Mar 17, 2017 2:27 pm    Post subject:   TS triggers for randomizer? Reply with quote

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?

Back to top
View user's profile Send private message
E1 Elite
Cyborg Informer


Joined: 28 May 2013

PostPosted: Fri Mar 17, 2017 3:20 pm    Post subject: Reply with quote

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.

Back to top
View user's profile Send private message
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Fri Mar 17, 2017 3:44 pm    Post subject: Reply with quote

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.

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Mar 17, 2017 3:50 pm    Post subject: Reply with quote

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. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Back to top
View user's profile Send private message
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Fri Mar 17, 2017 4:17 pm    Post subject: Reply with quote

LKO wrote:

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


CagedBaby.png
 Description:
 Filesize:  1.68 MB
 Viewed:  527 Time(s)

CagedBaby.png



Randomizer.gif
 Description:
 Filesize:  201.71 KB
 Viewed:  527 Time(s)

Randomizer.gif



Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Mar 17, 2017 5:21 pm    Post subject: Reply with quote

Tuc0 wrote:
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. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Back to top
View user's profile Send private message
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Fri Mar 17, 2017 5:50 pm    Post subject: Reply with quote

Lin Kuei Ominae wrote:

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.

Back to top
View user's profile Send private message
Crimsonum
Seth


Joined: 14 Jul 2005
Location: The fine land of Finland

PostPosted: Fri Mar 17, 2017 6:49 pm    Post subject: Reply with quote

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.
_________________
Twisted Insurrection mapper & moderator

Back to top
View user's profile Send private message Visit poster's website
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Mar 17, 2017 9:48 pm    Post subject: Reply with quote

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. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Back to top
View user's profile Send private message
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Fri Mar 17, 2017 11:21 pm    Post subject: Reply with quote

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)


CivRandomizer.gif
 Description:
 Filesize:  345.98 KB
 Viewed:  469 Time(s)

CivRandomizer.gif



Back to top
View user's profile Send private message
Crimsonum
Seth


Joined: 14 Jul 2005
Location: The fine land of Finland

PostPosted: Fri Mar 17, 2017 11:27 pm    Post subject: Reply with quote

Lin Kuei Ominae wrote:
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.
_________________
Twisted Insurrection mapper & moderator

Back to top
View user's profile Send private message Visit poster's website
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Mon Mar 20, 2017 9:25 pm    Post subject: Reply with quote

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.

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Mon Mar 20, 2017 9:48 pm    Post subject: Reply with quote

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. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Back to top
View user's profile Send private message
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Mon Mar 20, 2017 10:09 pm    Post subject: Reply with quote

LKO wrote:
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

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Mon Mar 20, 2017 10:35 pm    Post subject: Reply with quote

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. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Back to top
View user's profile Send private message
Isaac_The_Madd
AA Infantry


Joined: 16 Jul 2015

PostPosted: Tue Mar 21, 2017 2:46 am    Post subject: Reply with quote

This post is only to clear things up since LKO seems to have forgotten how Visceroid logic works. (Has it been a while since you used this LKO? #Tongue)

Setting SmallVisceriod to yes on a Vehicle means two of them will merge into what whatever LargeVisceroid is set in [General]. (Sets wander and Merge)

Setting LargeVisceriod to yes on a Vehicle just means it will wander without merging. (Wander only)

SmallVisceriod in [General] however sets what infantry will turn into when they die in Tiberium.

Back to top
View user's profile Send private message
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Tue Mar 21, 2017 10:09 am    Post subject: Reply with quote

LKO wrote:
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 Smile
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.

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Tue Mar 21, 2017 10:24 am    Post subject: Reply with quote

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.


@Isaac: you're right. thanks for clearing that up.
_________________
SHP Artist of Twisted Insurrection. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Back to top
View user's profile Send private message
E1 Elite
Cyborg Informer


Joined: 28 May 2013

PostPosted: Tue Mar 21, 2017 10:26 am    Post subject: Reply with quote

Like LKO said, some colors can be changed in rules.ini only, not in maps.
LightGrey has to be changed in rules.ini.

Refer - https://ppmforums.com/viewtopic.php?t=35605

Back to top
View user's profile Send private message
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Tue Mar 21, 2017 5:47 pm    Post subject: Reply with quote

LKO wrote:
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.

E1 Elite wrote:
Refer - https://ppmforums.com/viewtopic.php?t=35605

Thanks for link, lot of useful info  Smile

Back to top
View user's profile Send private message
E1 Elite
Cyborg Informer


Joined: 28 May 2013

PostPosted: Tue Mar 21, 2017 6:18 pm    Post subject: Reply with quote

Tuc0 wrote:
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.

Back to top
View user's profile Send private message
Tuc0
Soldier


Joined: 26 Sep 2016
Location: Slovakia

PostPosted: Tue Mar 21, 2017 6:50 pm    Post subject: Reply with quote

E1 Elite wrote:

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

[Colors]
AwesomeColor=205,100,50 ; 50

[Riparius]
Color=AwesomeColor

Back to top
View user's profile Send private message
E1 Elite
Cyborg Informer


Joined: 28 May 2013

PostPosted: Tue Mar 21, 2017 7:24 pm    Post subject: Reply with quote

Just checked, any color from the rules.ini cannot be changed in maps, but
you can have new colors in maps.

MP player colors are linked to its index number in rules.ini, can't do much
about it apart from hacking.

And tiberium index is hardcoded and whichever tiberium you are trying to
modify has to be declared again in maps like

[Tiberiums]
0=Riparius
2=Vinifera

0=abc would also do if modifying Riparius. And index is linked to its tib type
as in rules.ini like 2 is for Vinifera.

Example map (dn version) - https://ppmforums.com/viewtopic.php?t=35702

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [23 Posts] View previous topic :: View next topic
 Forum index » Modding Central » Tiberian Sun Editing Forum » Mapping Discussion
Jump to:  
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


Powered by phpBB © phpBB Group

Wildcard SSL Certificates
[ Time: 0.3530s ][ Queries: 17 (0.0063s) ][ Debug on ]