Jump to content

Scripting Help


Recommended Posts

Posted

I would like some of my Rodians to use a blaster pistol instead of the e-11 or disuptor.  Now, the only tutorials I can find is the one on here and whatever is in the Icarus Manual so bear with me here.  Using part of the Gingerbread tutorial for Desann and the manual I was able to come up with this.

 

rem ( "Rodian Pistol" );
 
affect ( "rodian", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@@weaponx_NAMES*/ "WP_BLASTER_PISTOL" );
}
 
I have my Rodian set to "NPC_targetname" with a value of "rodian"
My scriptrunner is set to  "usescript"  with a value of "icestationwampa/script1" which is the folder/file in my scripts folder.
My trigger is linked to the scriptrunner and the trigger is also linked to the npc_rodian.
 
My script is triggered in the test map and do not get any errors but my Rodian still spawns with a Tenloss Disruptor. 
 

 

Posted

yes, sometime there's that issue, i know. Look IrocJeff: do that:

set a spawnscript key for your rodian.

in the script you will make put simply set ( /*@SET_TYPES*/ "SET_WEAPON", /*@weaponx_NAMES*/ "WP_BLASTER_PISTOL" );

NO affect nothing of nothing. when rodian will spawn, get the blaster. is the faster way. :)

i notice that the affect command is case sensitive with NPC_targetname.

be careful: if NPC_targetname value is Rodian and You tell "affect rodian" script Not function. is Very sensible to the big or thin letters.

Posted

Can't you just make a new NPC instead? Would be much easier.

 

Well, I really don't know how to do this. I'm probably going with Asgarath's method, but, can you link a tutorial or something? It may be beneficial in the future. I'd love to add some different types of Rodians if at all possible. Maybe different skins and stuff.

Posted

yes, sometime there's that issue, i know. Look IrocJeff: do that:

set a spawnscript key for your rodian.

in the script you will make put simply set ( /*@SET_TYPES*/ "SET_WEAPON", /*@weaponx_NAMES*/ "WP_BLASTER_PISTOL" );

NO affect nothing of nothing. when rodian will spawn, get the blaster. is the faster way. :)

i notice that the affect command is case sensitive with NPC_targetname.

be careful: if NPC_targetname value is Rodian and You tell "affect rodian" script Not function. is Very sensible to the big or thin letters.

 

 

Hey, thanks for the help!! I've been trying a bit here and there for two days trying get this to work! 

Asgarath83 likes this
Posted

Well, I really don't know how to do this. I'm probably going with Asgarath's method, but, can you link a tutorial or something? It may be beneficial in the future. I'd love to add some different types of Rodians if at all possible. Maybe different skins and stuff.

Just typed one out for you.  :winkthumb:

 

[sharedmedia=tutorials:tutorials:146]

 

 

Asgarath83 likes this
Posted

Hurray! That is a pretty good overview. Thanks for writing it. Are there any # limits to adding NPC's to the game? Like there are only so many slots for this NPC or that one?

Posted

Hurray! That is a pretty good overview. Thanks for writing it. Are there any # limits to adding NPC's to the game? Like there are only so many slots for this NPC or that one?

There's a limit, but I think it has to do with how many lines are used total. Which is why I said to delete lines that you set at default values. I don't know too much about it, I think @@eezstreet was the one who explained how it works to me before.

 

But the limit isn't unreasonable. Most people don't run into it.

 

Posted

I think there was something like there can only be ~16 NPC types spawned at once...in multiplayer? Or was that only vehicles..

 

There is also the overall size of the .NPC text files combined, and maybe a per-file character limit too. It's not too much of a problem, you're more likely to run into errors with too many vehicle NPCs.

Circa likes this
Posted

Iroc Jeff , if you use the openjk exe for run your game, you can have an hundred of NPC and sab file with full line commands without crash anything. :)

I am glad to see i help you, really! ^_^

remember: spawnscript is the way for making every kind of customizable NPC into your map! you can custom ANYTHING: earshot, visrange,behavour, weapon, force power, health and armor point, aim, aggression, if chase or not enemy or stand in defensive mode, you can also setting a loop of action for fight against NPC: for example:

loop -1

Set weapon WP_THERMAL

wait 10000

Set weapon WP_BLASTER

set Alt_fire true

set shoot spacing: 500

wait 20000

Set weapon WP_DISRUPTOR...

wait 15000

Set Weapon WP_REPEATER...

set altfire true

set chase enemies true.

wait 20000

"End of loop." :D

enemy so can switch weapons and attack you with that sequence until you kill him. when you kill set a deathscript and in the deathscript set the command

-Flush (the red flush of icarus)

so you stop the loop. is little nasty if loop continue to the infinite also when NPC is dead. LOL

Make NPC files customizzable are good for making usable the NPC for playermodel command or for create the NPC using into the mod. but if you want a more large customizzation of your NPC, with spawnscript EVERY enemy can have a custom parameter, so youu can create a various game, because you can do NPC with spawnscript in a modality that there aren't 2 equal NPC. So every oone has his own skills. :D is long as work, but you can create a battle with a large amount of variables, more realistic of a battle with alla NPC with the same parameter, same weapon, same health... yawn -_- XD

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...