I’m not sure what the problem is in the way I’m using modules. I’ve researched for awhile and can’t find anything that really explains it.
I have created the following module for the purpose of cycling vending machines. ( all of this is done because you can’t turn vending machine’s cycle ability to off…) and I don’t want to clutter up my other code where I want to actually cycle these vending machines.
I don’t know if I created this module correctly and if it needs to have a class or not. I’m not sure how I’d edit the editables actually if it’s not a device that’s in the level. I might have to just make to creative devices now that I think about it. can modules have editables? Please review the code and answer my questions if you can.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
VendingModule<public> := module:
vending_manager := class(creative_device):
@editable
CastleTransform : transform = transform{
Translation := vector3{X := 100.0, Y := 200.0, Z := 0.0},
Rotation := MakeRotationFromYawPitchRollDegrees(YawRightDegrees := 0.0, PitchUpDegrees := 0.0, RollClockwiseDegrees := 0.0),
Scale := vector3{X := 1.0, Y := 1.0, Z := 1.0}
}
@editable
IceHouseTransform : transform = transform{
Translation := vector3{X := 300.0, Y := 200.0, Z := 0.0},
Rotation := MakeRotationFromYawPitchRollDegrees(YawRightDegrees := 0.0, PitchUpDegrees := 0.0, RollClockwiseDegrees := 0.0),
Scale := vector3{X := 1.0, Y := 1.0, Z := 1.0}
}
@editable
IceChairTransform : transform = transform{
Translation := vector3{X := 500.0, Y := 200.0, Z := 0.0},
Rotation := MakeRotationFromYawPitchRollDegrees(YawRightDegrees := 0.0, PitchUpDegrees := 0.0, RollClockwiseDegrees := 0.0),
Scale := vector3{X := 1.0, Y := 1.0, Z := 1.0}
}
@editable
ArcticTransform : transform = transform{
Translation := vector3{X := 700.0, Y := 200.0, Z := 0.0},
Rotation := MakeRotationFromYawPitchRollDegrees(YawRightDegrees := 0.0, PitchUpDegrees := 0.0, RollClockwiseDegrees := 0.0),
Scale := vector3{X := 1.0, Y := 1.0, Z := 1.0}
}
@editable
var CastleVMs : []vending_machine_device = array{}
@editable
var IceHouseVMs : []vending_machine_device = array{}
@editable
var IceChairVMs : []vending_machine_device = array{}
@editable
var ArcticVMs : []vending_machine_device = array{}
# Transform to send the vending machine to when 'hiding'
@editable
var HideTransform : transform = transform{
Translation := vector3{X := 0.0, Y := 0.0, Z := -1000.0},
Rotation := MakeRotationFromYawPitchRollDegrees(YawRightDegrees := 0.0, PitchUpDegrees := 0.0, RollClockwiseDegrees := 0.0),
Scale := vector3{X := 1.0, Y := 1.0, Z := 1.0}
}
SpawnVendingMachines(Wave: int)<decides><transacts>: void =
if (Wave < 4 and Wave > 0 and Wave < CastleVMs.Length):
# Remove current vending machines
CastleVMs[Wave -1].TeleportTo[HideTransform]
IceHouseVMs[Wave-1].TeleportTo[HideTransform]
IceChairVMs[Wave-1].TeleportTo[HideTransform]
ArcticVMs[Wave-1].TeleportTo[HideTransform]
# Bring in next round of vending machines
CastleVMs[Wave].TeleportTo[HideTransform]
IceHouseVMs[Wave].TeleportTo[HideTransform]
IceChairVMs[Wave].TeleportTo[HideTransform]
ArcticVMs[Wave].TeleportTo[HideTransform]```
I want to be able to call this 'SpawnVendingMachines()' function in another class.