One thing to mention on the topic is that with the new way the trigger editor works; it works much like a library in the local window. So now you can hide variables and action definitions for use in their local folder only. Making records mostly necessary only if you have a lot of variables in one place.
Also, the caster doesn't need to be a different unit. If this was simply for wandering, you can use the same unit as I did.
If you want to provide threat to a unit through behaviors, then yeah the unit would need to already be on the map at the same time, but you could catalog the unit in an array for use in this situation if you wanted to.
With the help of helpful people in the IRC, I was able to use modulation to fix the offset problem.
I doubt it will work for anyone else without the exact, same, problem but here it is just in case:
CheckandMarkRoom(ValidationandMarking)Options:FunctionReturnType:BooleanParametersSizeX<Integer>SizeY<Integer>Point<Integer>Region<Integer>FacingOpposite<Real>CreationDirectionY<BasicCreationDirection>CreationDirectionX<BasicCreationDirection>GrammarText:CheckandMarkRoom(ValidationandMarking)(SizeX,SizeY,Point,Region,FacingOpposite,CreationDirectionY,CreationDirectionX)HintText:(None)CustomScriptCodeLocalVariablesCreationDirectionY<BasicCreationDirection>CreationDirectionX<BasicCreationDirection>i=0<Integer>x=0<Integer>FinalBoolean=True<Boolean>TileFlag=0<Integer>AdditionalOffset=0<Integer>ActionsPlayerGroup-Pickeachplayerin(ActivePlayers)anddo(Actions)ActionsSetaLoadingBarfor(Pickedplayer)containingthetext"DEBUG"withthemaximumprogressofbaronebeingSizeXandthemaximumprogressofthebartwobeingSizeY.Variable-SetCreationDirectionX=CreationDirectionXVariable-SetCreationDirectionY=CreationDirectionYGeneral-Switch(Actions)dependingonCreationDirectionYCasesGeneral-If(Down)ActionsGeneral-If(Left)ActionsGeneral-If(Right)ActionsDefaultGeneral-Switch(Actions)dependingonCreationDirectionXCasesGeneral-If(Left)ActionsGeneral-If(Up)ActionsGeneral-If(Down)ActionsDefaultGeneral-Foreachintegerxfrom0toSizeXwithincrement1,do(Actions)ActionsLoadingBar(Update)(1,Neutral,"Creating Room",0,0,i,x)General-Foreachintegerifrom0toSizeYwithincrement1,do(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Point+i)<=47(Region+x)<=83ThenLoadingBar(Update)(1,Neutral,"Creating Room",0,0,i,x)General-If(Conditions)thendo(Actions)elsedo(Actions)IfFlagofTile[(Region+x)][(Point+i)] == 0
Then
Else
Variable - Set Final Boolean = False
Else
Variable - Set Final Boolean = False
General - Wait 0.0 Game Time seconds
General - Wait 0.0 Game Time seconds
General - If (Conditions) then do (Actions) else do (Actions)
If
Final Boolean == True
Then
General - Switch (Actions) depending on Creation Direction Y
Cases
General - If (Down)
Actions
General - If (Left)
Actions
General - If (Right)
Actions
Default
General - Switch (Actions) depending on Creation Direction X
Cases
General - If (Left)
Actions
General - If (Up)
Actions
General - If (Down)
Actions
Default
General - For each integer x from 0 to Size X with increment 1, do (Actions)
Actions
Loading Bar (Update)(1, Neutral, "Creating Room", 0, 0, i, x)
General - For each integer i from 0 to Size Y with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(x mod 2) == 1
Then
Variable - Set Additional Offset = -1
Else
Variable - Set Additional Offset = 0
Loading Bar (Update)(1, Neutral, "Creating Room", 0, 0, i, x)
General - If (Conditions) then do (Actions) else do (Actions)
If
Or
Conditions
x == 0
x == Size X
Then
General - If (Conditions) then do (Actions) else do (Actions)
If
Or
Conditions
i == 0
i == Size Y
Then
Variable - Set Tile Flag = 2
Else
Variable - Set Tile Flag = 1
Else
Variable - Set Tile Flag = 1
General - If (Conditions) then do (Actions) else do (Actions)
If
Or
Conditions
x == 0
x == Size X
Then
Variable - Set Flag of Tile[(Region+x)][(Point+i)] = Tile Flag
Else
Variable - Set Flag of Tile[(Region+x)][(Point+AdditionalOffset)] = Tile Flag
Variable - Set Flag of Tile[(Region+x)][(Point+(SizeY+AdditionalOffset))] = Tile Flag
General - Wait 0.0 Game Time seconds
General - Wait 0.0 Game Time seconds
Else
Variable - Set Final Boolean = False
So I am taking the advice of someone from that other thread and am going to post in pieces where I need help.
I've gotten pretty far along since then but hit a snag when trying to create my validation engine.
A quick rundown:
When a room is being created it has to validate that the points in questions aren't already occupied by tiles. So as not to intersect with walls of other rooms and doodads and what have you.
To do this, I need to go through the arduous task of creating tons of math to make sure:
The position isn't above or below the array (outside the map)
the position isn't nonexistent (where a point isn't occupied; near an entry door.)
And so on.
Right now, while I could use help with the whole thing, the only part really getting me is the picture section. It's a debug so that's why it's a function that creates things. Anyway.
Before continuing:
= wall tile
= corner tile
So as you can see, when I get in game not only are corner tiles overlapping wall tiles and vice-versa (corner tiles go in the, you guessed it, corner. As fillers to look nice), but one of the wall tiles even shifts down a position.
One thing I know is that the game catalogs the points in an odd fashion. The first unit to be cataloged into a point is the second in the row, and the second the first.
Normally this wouldn't matter but maybe fresh eyes will catch something I've been unable to.
Thanks in advance.
EDIT: A few things I missed at first.
there is also a(?) wall missing. It may be more, it's hard to tell.
testing takes upwards of 6 minutes because of the way the map initializes. I'll try to get back to people in one bulk post rather than individual posts. If I take a while keep this in mind.
there are 83 regions (or the X of the array) and 47 points per region (or the Y of the array)
in the more recent picture (same file name but I gave a description for this one) not only are most walls shifted up or down incorrectly, but corners just seem to spawn however they want.
my math skills are pretty bad, so please excuse any obvious errors and explain them as detailed as possible.
Pretty sure that's it. I'll edit in more if I remember more.
LevelUnitUpgradeOptions:Action,CreateThreadReturnType:(None)ParametersPlayer=0<Integer>Array#<Real>Unit=NoUnit<Unit>GrammarText:LevelUnitUpgrade(Player,Array#,Unit)HintText:Levelsunitsviaupgrades.CustomScriptCodeLocalVariablesActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfConvertingtoUpgrades==TrueThenGeneral-Switch(Actions)dependingonCappingUpgradesCasesGeneral-If(False)ActionsGeneral-Pickeachintegerfrom1toMaximumUnitCount,anddo(Actions)ActionsGeneral-Switch(Actions)dependingon(UnittypeofUnit)CasesGeneral-If(UnitArray[(Pickedinteger)])
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Increasing Upgrades Beyond 100 == True
Then
General - Switch (Actions) depending on (Upgrade for Unit[(Pickedinteger)] count for player Player, counting In Progress Or Better)
Cases
General - If (100)
Actions
Tech Tree - Add 1 to Upgrade for Unit x100[(Pickedinteger)] upgrade for player Player
Tech Tree - Set Upgrade for Unit[(Pickedinteger)] upgrade level to 0 for player Player
Default
Tech Tree - Add 1 to Upgrade for Unit[(Pickedinteger)] upgrade for player Player
Else
Tech Tree - Add 1 to Upgrade for Unit[(Pickedinteger)] upgrade for player Player
Default
Default
General - Pick each integer from 1 to Maximum Unit Count, and do (Actions)
Actions
General - Switch (Actions) depending on (Unit type of Unit)
Cases
General - If (Unit Array[(Pickedinteger)])
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Upgrade for Unit W/ Cap[(Pickedinteger)] count for player Player, counting In Progress Or Better) < MaximumUpgradeW/CapCountThenTechTree-Add1toUpgradeforUnitW/Cap[(Pickedinteger)]upgradeforplayerPlayerElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfIncreasingUpgradesBeyond100 ==TrueThenGeneral-Switch(Actions)dependingon(UpgradeforUnit[(Pickedinteger)]countforplayerPlayer,countingInProgressOrBetter)CasesGeneral-If(100)ActionsTechTree-Add1toUpgradeforUnitx100[(Pickedinteger)]upgradeforplayerPlayerTechTree-SetUpgradeforUnit[(Pickedinteger)]upgradelevelto0forplayerPlayerDefaultTechTree-Add1toUpgradeforUnit[(Pickedinteger)]upgradeforplayerPlayerElseTechTree-Add1toUpgradeforUnit[(Pickedinteger)]upgradeforplayerPlayerDefaultElse
Not sure how well this will work now, as the library I pulled this from is rather old, but the basic premise should remain the same.
Well right now I think I got the creation down. I use regions to load in the points and so I am using a point array of [84](regions)[47](maximum points) and then manually adding offsets where applicable.
What I really need to figure out now is how to make sure each room is reachable and that the doors leading to the next room (or basically that generate the next room) are also reachable.
If you wouldn't mind my asking, what is the basic premise you used?
0
@hellmapperextreme2013: Go
I would use an Action Definition (if you aren't already) and have it look something like:
The way you had it before I think was creating a nested iteration. And suffice it to say you can't have a while loop within a while loop.
Something similar to @Dryopes: Go, except it figures this out in the same trigger.
0
One thing to mention on the topic is that with the new way the trigger editor works; it works much like a library in the local window. So now you can hide variables and action definitions for use in their local folder only. Making records mostly necessary only if you have a lot of variables in one place.
0
@pokenoufl: Go
0
Solved. Had a friend come help me. He figured it out.
Please delete this thread.
0
@Cardanis: Go
Does the issue order trigger look like this?
If so, make sure to change "Order With No Target" to "Order With Target" or otherwise.
If not please post more information regarding the trigger. A screen capture is preferable.
0
@redbean87: Go
Haha, well I'm glad to hear it worked.
If you post some code I could try to make sense of it. :P
0
@redbean87: Go
You'd have to add it to the unit after it's created if there are no units on the map.
Something like:
Also, the caster doesn't need to be a different unit. If this was simply for wandering, you can use the same unit as I did.
If you want to provide threat to a unit through behaviors, then yeah the unit would need to already be on the map at the same time, but you could catalog the unit in an array for use in this situation if you wanted to.
0
@redbean87: Go
Add behavior to unit from caster works...I use it all the time. How exactly are you using it?
0
@SoulTaker916: Go
With the help of helpful people in the IRC, I was able to use modulation to fix the offset problem.
I doubt it will work for anyone else without the exact, same, problem but here it is just in case:
0
So I am taking the advice of someone from that other thread and am going to post in pieces where I need help.
I've gotten pretty far along since then but hit a snag when trying to create my validation engine.
A quick rundown: When a room is being created it has to validate that the points in questions aren't already occupied by tiles. So as not to intersect with walls of other rooms and doodads and what have you. To do this, I need to go through the arduous task of creating tons of math to make sure:
Right now, while I could use help with the whole thing, the only part really getting me is the picture section. It's a debug so that's why it's a function that creates things. Anyway.
Before continuing:
So as you can see, when I get in game not only are corner tiles overlapping wall tiles and vice-versa (corner tiles go in the, you guessed it, corner. As fillers to look nice), but one of the wall tiles even shifts down a position.
One thing I know is that the game catalogs the points in an odd fashion. The first unit to be cataloged into a point is the second in the row, and the second the first.
Normally this wouldn't matter but maybe fresh eyes will catch something I've been unable to.
Thanks in advance.
EDIT: A few things I missed at first.
Pretty sure that's it. I'll edit in more if I remember more.
0
@bakonking: Go
What's the difference?
0
@cleanto: Go
Not sure how well this will work now, as the library I pulled this from is rather old, but the basic premise should remain the same.
0
@Ahli634: Go
Ah, got it.
I'm not sure if that would work with my system but I'll see what I can do.
@Mugen245: Go
Umm...okay?
0
@DuckyTheDuck: Go
This, but you can also switch weapons via catalog. I forget how, but I've done it before so.
Unfortunately, you cannot add or remove weapons via catalogs.
0
@Ahli634: Go
Well right now I think I got the creation down. I use regions to load in the points and so I am using a point array of [84](regions)[47](maximum points) and then manually adding offsets where applicable.
What I really need to figure out now is how to make sure each room is reachable and that the doors leading to the next room (or basically that generate the next room) are also reachable.
If you wouldn't mind my asking, what is the basic premise you used?