PDA

View Full Version : problems with scripting


The Old Man
2002-08-31, 23:57
Author Message
Guest






Posted: 13 Aug 2002 05:11 am Post subject: problems with scripting

--------------------------------------------------------------------------------

Hi

Iám a newbie to scripting and feels that that part of mapmaking is not my strongly part at all. I have tried to find some help on others pages without success.
In my aifile I have put in Eyeroniks Ai marching script and that works. After that I thought it might be easy to put in more aisoldiers but I canīt get it to work.
I have also read and checked others aiscripts to put in aisoldiers but nothing works for me. I just want put in enemy as simple as possible.

This is how my script looks now:
-----------------------------------------
nazi1
{
attributes
{
aim_accuracy 0.75
attack_crouch 0.1
idle_crouch 0.1
}

spawn
{
trigger nazi1 marchloop // This will begin the Marching loop.
}

trigger marchloop
{
walktomarker point1
walktomarker point2
facetargetangles point3
wait 4000
walktomarker point3
wait 4000
trigger nazi1 marchloop // Restarts the marching loop.
}

death
{
}

enemysight
{
}


nazi2
{
attributes
{
aim_accuracy 0.1
starting_health 50
aggression 0.8
statetype alert
}

spawn
{
giveweapon weapon_thompson
setammo ammo_45cal 200
setclip weapon_thompson 32
selectweapon weapon_thompson
}

bulletimpact
{
clearanim
statetype alert
wait 1000
}
}
------------------------------------
in GTKRadiant I have placed the nazi1 like in the tutorial. nazi2 I have placed in a another place on the map and give him the ainame nazi2.

When I try to run the map this error shows up:
------------------------------------
AICast_ScriptParse (), error
(line 63): "}" expected, end of script found.
------------------------------------

I donīt know/understand what the problem is.
How do I put in several enemys?

Also, I want to know a easy as possible script to start the player, you know Playerstart in the script. I have looked at others scripting but they have used triggers and so on. I just want to equip my player with a weapon at start.

Sorry for the long post, and my non-knowledge about scripting. I have really tried to learn from other scripts but I canīt understand the whole part of them, how they works.

Many thanks already!
/SWEFighter

Back to top


Guest






Posted: 13 Aug 2002 06:22 am Post subject:

--------------------------------------------------------------------------------

the AI already have default scripting as part of the game so just place more enemies in the level and when they see you they'll shoot. If you want to have them march or act a certain way you need to have all the script including death etc for each one?

There is a scripting manual to refer to, and Rumble did some samples where they talk to each other BUT if you want simple, just stick them, zombies & civilians in the level EyeRoniK provided and watch them battle it out! *G*

Back to top


eyeronik



Joined: 01 Aug 2002
Posts: 75
Location: uk
Posted: 13 Aug 2002 07:47 am Post subject:

--------------------------------------------------------------------------------

Not 100% because i never do it now, but at the start of the script, youve got a } which means its open, but at nazi 2 youve put another } open one in, so try taking that out:

nazi2
{ -this one
attributes
{

and leave 2 brackets at the end like you have

bulletimpact
{
clearanim
statetype alert
wait 1000
}
} - script over

like i say im not sure, but thats what it might be

Back to top


SWEFighter



Joined: 06 Aug 2002
Posts: 3

Posted: 21 Aug 2002 04:13 am Post subject:

--------------------------------------------------------------------------------

My god..was it so simple to insert enemys..embarrising...
I understand that this is the easiest way but i thought they all needed scripting so i never even tried to just insert aisoldier and so on.
Eyeronik - I tried to remove that (and some others later on) but I never got it to work. I will try further..sometimes it will be correct

Thanks boys
/SWEFighter

Back to top


krekits



Joined: 04 Aug 2002
Posts: 33

Posted: 21 Aug 2002 05:51 am Post subject:

--------------------------------------------------------------------------------

Your script was missing a }.

This is how it should look:

------------start of script-------------

nazi1
{
attributes
{
aim_accuracy 0.75
attack_crouch 0.1
idle_crouch 0.1
}

spawn
{
trigger nazi1 marchloop // This will begin the Marching loop.
}

trigger marchloop
{
walktomarker point1
walktomarker point2
facetargetangles point3
wait 4000
walktomarker point3
wait 4000
trigger nazi1 marchloop // Restarts the marching loop.
}

death
{
}

enemysight
{
}
}

nazi2
{
attributes
{
aim_accuracy 0.1
starting_health 50
aggression 0.8
statetype alert
}

spawn
{
giveweapon weapon_thompson
setammo ammo_45cal 200
setclip weapon_thompson 32
selectweapon weapon_thompson
}

bulletimpact
{
clearanim
statetype alert
wait 1000
}
}

----------end of script-----------


You forgot one } right before the 'nazi2' line.