Scripts / Random entity Spawn Script

Author
Message
cuteboy
7
Years of Service
User Offline
Joined: 18th Jul 2017
Location:
Posted: 18th Jul 2017 17:44
I need a script to spawn a group of random(value) of enemies in a radius around a entity with each enemy having random facings,position and random patrol speeds..



Just a code example would be great so I have something to work off..
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 19th Jul 2017 18:23
Quote: "Just a code example would be great so I have something to work off.."

Well, this might help, thought.

I've attached script to the barrel.
You might have to improve it, and of course most likely there is a most complex way to get it, but I prefer start with the easier for you.

Using 6 neutral and 2 combat mutant soldiers.



Script is well commented, so it can help you as start point, at least I hope so.



3com

Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 20th Jul 2017 16:44
That's a very cool script 3com.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GT 740
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 20th Jul 2017 17:20
Glad you like.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 6th Aug 2017 02:01
This isn't entirely related but is there a way to Show and Hide an entity using Hide(name) and Show(name) instead of using their ID numbers? For some reason this does not work for me when I use an entity name.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 6th Aug 2017 14:30 Edited at: 6th Aug 2017 14:33
Name the entity you want spawned, put the name of that entity in the ifused field of your trigger object/zoned, and use a script with SpawnIfUsed(e).

Here's some examples:

1. Spawns an entity whenyou get close to the trigger object:


2. Spawns an entity when you enter a trigger zone:

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.

Login to post a reply

Server time is: 2024-12-23 01:01:52
Your offset time is: 2024-12-23 01:01:52