I need help on command to spawn thing

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
guest6777
Posts: 53
Joined: Fri Dec 16, 2016 2:50 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Brazil, São Paulo, Campinas
Contact:

I need help on command to spawn thing

Post by guest6777 »

How to make a command that every time the player join it generates an object eg friend monster?
User avatar
Eliot_L
Posts: 34
Joined: Thu Mar 08, 2018 3:40 am
Contact:

Re: I need help on command to spawn thing

Post by Eliot_L »

I think you could accomplish this with a ZScript EventHandler. Try overriding PlayerEntered and then looking up the player object as described on that wiki page. Something like this might work but I haven't tested it:

Code: Select all

void PlayerEntered(PlayerEvent e) {
  PlayerInfo player = players[e.PlayerNumber];
  player.mo.Spawn("DoomImp", (0.0, 0.0), NO_REPLACE);
}
User avatar
guest6777
Posts: 53
Joined: Fri Dec 16, 2016 2:50 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Brazil, São Paulo, Campinas
Contact:

Re: I need help on command to spawn thing

Post by guest6777 »

thanks for help
Post Reply

Return to “Scripting”