Flashfearless Posted January 18, 2022 Share Posted January 18, 2022 So I've been searching for how to do this all day. I found a few people asking the same thing, but all threads seem to end unsatisfactorily. The main suggestion given every time is a simple behavED script that sets the player's weapons to none, then gives them the desired weapon. The script compiles fine. The problem is it never works in game. I have tried it with a target_scriptrunner with the info_player_start. I have also tried setting a spawnsript in the info_player_start itself. I have seen some people suggest that it is actually impossible to have scripts affect the info_player_start. Does anyone have a definitive answer on this? I'm trying to create a map where you play as a simple pirate, who is not a jedi. Link to comment
mrwonko Posted January 18, 2022 Share Posted January 18, 2022 There's a "NOWEAPON" spawnflag on info_player_start, as far as I remember. Enabling that should be sufficient, as you start the game without any force powers by default. That said, both spawnscript and target_scriptrunner should work for running a script on the player upon spawn. Flashfearless likes this Link to comment
MagSul Posted January 18, 2022 Share Posted January 18, 2022 To do this myself, I had the info_player_start targetting a target_scriptrunner which ran "intro.ibi" At the end of the intro script, I put a command to use a target_scriptrunner with a targetname of "forcepowers" My "forcepowers.ibi" was just a list of what Force powers I wanted the player to have and at what level. At the bottom is also a command to specify a lack of weapon. You could change that to a blaster or such if you preferred, of course. I hope this visualisation helps. Flashfearless likes this Link to comment
Flashfearless Posted January 18, 2022 Author Share Posted January 18, 2022 Alright! I have made some progress. My first problem was that I had the script written with affect set to info_player_start. I changed it to "player" and set an NPC_Targetname on the info_player_start as "player" and now the script runs. However, it isn't taking away the lightsaber. It is giving me the weapon I selected, but the lightsaber is still in my inventory. This is my incredibly simple script: affect ( "player", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_NONE" ); set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_BOWCASTER" ); } I know about the stun_baton spawnflag/spawnflag 32. I know! But I want my script to work properly. Link to comment
MagSul Posted January 18, 2022 Share Posted January 18, 2022 Popped open my map to see if I'd left anything out! I noticed you mentioned the stun_baton flag. Do you not have the "noweapon" option shown here? Spawnflags 64. When I don't tick it, I get given a lightsaber in addition to whatever I dictate my script. After ticking it, all worked fine. I added the melee weapon in addition to the bowcaster in this example. Link to comment
mrwonko Posted January 19, 2022 Share Posted January 19, 2022 If you enable "runonactivator" on the target_scriptrunner that the info_player_start targets, you don't need the "affect" in your script. But yeah, like MagSul said (and like I did in my initial reply), the noweapon flag suffices. MagSul likes this Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now