Dynamic resource creation 3

Updated: 2025-10-09

And finally, they can also be created if the need arises.

You just need to keep in mind that a resource cannot be modified once it is created; it can only be blocked with the LOCK block.

Example

/*

Contexts and modules. Dynamic creation 3


*/
SYSTEM {TYPE:OPTIONS, SPEED:5}
Position {NAME:pos_exit,X:581,Y:407}

; --- Facility defined in the classic way ---
FACILITY {NAME:resource_static, CAPACITY:1,  X:496, Y:164}

START 200


;------------------------------------------------------
; --- Entity flow ---
GENERATE 10,0 {NAME:GEN1}
advance 15 {to:resource_static}

SEIZE resource_static      
ADVANCE 15        
RELEASE resource_static

if (R$(resource_dynamic,EXIST)==0)
	NEWFACILITY {NAME:resource_dynamic, CAPACITY:1,  X:300, Y:400}
endif

advance 15 {to:resource_dynamic}

SEIZE resource_dynamic    
ADVANCE 17          
RELEASE resource_dynamic

advance 15 {to:pos_exit}

TERMINATE 1