How to best set spawn points

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

How to best set spawn points

Postby BackRaw » Mon Jan 22, 2018 9:51 pm

Ayuto wrote:

Code: Select all

# Function name, arguments, return type
add_account ('POINTER', 'INT', 'BOOL', 'BOOL', 'STRING') VOID
add_context ('POINTER', 'POINTER') VOID
add_output ('POINTER', 'POINTER') VOID
autobuy ('POINTER',) VOID
become_ragdoll ('POINTER', 'POINTER') VOID
blind ('POINTER', 'FLOAT', 'FLOAT', 'FLOAT') VOID
bump_weapon ('POINTER', 'POINTER') BOOL
buy_internal ('POINTER', 'STRING') INT
clear_context ('POINTER', 'POINTER') VOID
clear_parent ('POINTER', 'POINTER') VOID
deafen ('POINTER', 'FLOAT') VOID
disable_damage_forces ('POINTER', 'POINTER') VOID
disable_shadow ('POINTER', 'POINTER') VOID
dispatch_effect ('POINTER', 'POINTER') VOID
dispatch_response ('POINTER', 'POINTER') VOID
drop_weapon ('POINTER', 'POINTER', 'POINTER', 'POINTER') VOID
enable_damage_forces ('POINTER', 'POINTER') VOID
enable_shadow ('POINTER', 'POINTER') VOID
end_touch ('POINTER', 'POINTER') VOID
equip_weapon ('POINTER', 'POINTER') VOID
fire_user1 ('POINTER', 'POINTER') VOID
fire_user2 ('POINTER', 'POINTER') VOID
fire_user3 ('POINTER', 'POINTER') VOID
fire_user4 ('POINTER', 'POINTER') VOID
give_named_item ('POINTER', 'STRING', 'INT') POINTER
ignite ('POINTER', 'POINTER') VOID
ignite_hitbox_fire_scale ('POINTER', 'POINTER') VOID
ignite_lifetime ('POINTER', 'POINTER') VOID
ignite_num_hitbox_fires ('POINTER', 'POINTER') VOID
increment_death_count ('POINTER', 'INT') VOID
increment_frag_count ('POINTER', 'INT') VOID
kill_hierarchy ('POINTER', 'POINTER') VOID
killed_npc ('POINTER', 'POINTER') VOID
on_rescue_zone_touch ('POINTER', 'POINTER') VOID
on_take_damage ('POINTER', 'POINTER') INT
post_think ('POINTER',) VOID
pre_think ('POINTER',) VOID
rebuy ('POINTER',) VOID
remove_context ('POINTER', 'POINTER') VOID
run_command ('POINTER', 'POINTER', 'POINTER') VOID
set_damage_filter ('POINTER', 'POINTER') VOID
set_fog_controller ('POINTER', 'POINTER') VOID
set_hud_visibility ('POINTER', 'POINTER') VOID
set_lighting_origin ('POINTER', 'POINTER') VOID
set_lighting_origin_hack ('POINTER', 'POINTER') VOID
set_model_scale ('POINTER', 'POINTER') VOID
set_parent ('POINTER', 'POINTER', 'INT') VOID
set_parent_attachment ('POINTER', 'POINTER') VOID
set_parent_attachment_maintain_offset ('POINTER', 'POINTER') VOID
set_transmit ('POINTER', 'POINTER', 'BOOL') VOID
start_touch ('POINTER', 'POINTER') VOID
switch_team ('POINTER', 'INT') VOID
teleport ('POINTER', 'POINTER', 'POINTER', 'POINTER') VOID
touch ('POINTER', 'POINTER') VOID
use ('POINTER', 'POINTER') VOID
weapon_switch ('POINTER', 'POINTER', 'INT') BOOL

Don't want to 'iterrupt' but I have a question regarding the entity.spawn function. Why doesn't it appear in the list? My question would be, can you hook the actual function instead of using a pre event for player_spawn? If this can be done, then the entity's origin would already be set, right?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: PreHook cancel/modify damage

Postby Ayuto » Mon Jan 22, 2018 9:56 pm

We haven't added a spawn function for CS:S (only for CS:GO. It's called _spawn). But I doubt the origin would already be set. I assume it's set during the spawn call (you can try a post-hook), but I haven't checked that. What exactly are you trying to do?
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Re: PreHook cancel/modify damage

Postby BackRaw » Mon Jan 22, 2018 10:02 pm

I want to set the player's spawn point as soon as possible in my UDM plugin. Sometimes a player would spawn on a default location and then 'flies' through the map to the new location (but really, really fast). But luckily you don't see it very often. Nonetheless I feel that the event player_spawn isn't called 'on time', subjectively speaking. Either that or getting the new spawn point is taking too long.

So basically I'm asking: is the (pre) event player_spawn the best I can use or is there something else I'm not aware about?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: PreHook cancel/modify damage

Postby Ayuto » Mon Jan 22, 2018 10:10 pm

What method do you use to set the location?
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: PreHook cancel/modify damage

Postby satoon101 » Tue Jan 23, 2018 12:19 am

The best way I have seen to do spawn points isn't to manually set the player's origin on/after spawn, but to remove the old spawn points and create new ones. Is there any reason you can't do that?

But this is getting off topic, so maybe deserves to be moved to its own thread. (I can do that once I am not on mobile)
Image
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Re: PreHook cancel/modify damage

Postby BackRaw » Fri Jan 26, 2018 2:52 pm

Ayuto wrote:What method do you use to set the location?
I'm not quite sure, just the best I guess lol.

satoon101 wrote:The best way I have seen to do spawn points isn't to manually set the player's origin on/after spawn, but to remove the old spawn points and create new ones. Is there any reason you can't do that?

But this is getting off topic, so maybe deserves to be moved to its own thread. (I can do that once I am not on mobile)
Yeah it's getting way too OT, I'm sorry. I already asked how to play around with info_player_(counter)terrorist entities, but I can't find the thread... maybe I'll start a new one.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: PreHook cancel/modify damage

Postby Ayuto » Fri Jan 26, 2018 5:03 pm

I found these two threads:
viewtopic.php?f=20&t=1426
viewtopic.php?f=10&t=1557

Note that those two entities are not networked in CS:GO. Thus, you need to utilize the BaseEntity class.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: PreHook cancel/modify damage

Postby satoon101 » Fri Jan 26, 2018 5:08 pm

This is where I handle them in GunGame's Random Spawn sub-plugin:

https://github.com/GunGame-Dev-Team/Gun ... cations.py


Edit: although, due to the recent BaseEntity update, I should probably change those to use the new built-in properties.

https://github.com/Source-Python-Dev-Te ... n/pull/235
Image
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Re: PreHook cancel/modify damage

Postby BackRaw » Fri Jan 26, 2018 11:26 pm

Thanks guys!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 46 guests