Easy-to-answer question(s).

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Easy-to-answer question(s).

Post by cjrs »

okay, i'm starting up a project. I'm going to make a little movie of Medal of Honor. However I only know a few scripting commands. Basically the actors are going to be Bots, and the voices are being done by friends of mine (sorta like RvB, except not as futuristic. :wink: )

Anyway, i'm going to be the cameraman, and I wanted to know something. I was going to set it in a custom map that (while noclipping on multiplayer) I would fly to a certain trigger area, press use, and the scene starts. I'm not sure how to make a trigger activate something though. Can anyone help me out?
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Post by cjrs »

Still can't figure it out. Yes I am an idiot. This is what I have:

Code: Select all

bot_move:

	$trig waittill trigger
	
	$ally moveto $path1
	wait .5
	$ally turnto $player

end

bot_move_again:

	$trig2 waittill trigger
	
	$ally moveto $path2
	wait .5
	$ally anim idle_crouch_grenade
	$ally say warn_player_cover

end

Anyway, that's plural (questions!). The next question I have is...is there a firing animation I can activate, something along the lines of $ally anim fire or something?
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

i think you should try runto (or walkto) rather than moveto, because moveto requires an animation to use.

as for the ai firing weapons, its possible. here i have a map and script that is victim to many many tests i have made in the past. the script is a big mess, but it execs a global script that has instructions in it. the global script is what makes the ai shoot.

all you have to do is

$aiguy fire

BUT (theres always a but)

he will shoot, and the bullets are real, but he doenst play any animation (his body doesnt kick back from the force of the gun)

you have to do some more advanced scripting to find out the correct "anim" to make him shoot and all. the global/exhaustgun.scr does it well, but its sorta buggy, and the m1garand has some probs as you can see in the test map. if you wanna see the test map, PASTE this link in your browser...

geocities.com/alc0h0lic47/aifire.zip

the name of the map is "test_exhaustgun"
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Post by cjrs »

Ahh yes. Well that should be easy enough. I want them to be real bullets of course. hehehe. I've got quite a plan in my head!

So, the serious thing here is, the trigger_use. I'm using a small box room that basically is my testing map. I use it for every new thing I learn (AI, Talking, Script stuff..yadda yadda). There's two Pathnodes ($path1 and $path2) and two use triggers (both surrounding any object I picked out). I go over to the use trigger, I hit use. My message comes up (Trigger one has fired OK!) for the first one, but he doesn't move. Same thing for the second one. No movement whatsoever.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Here is a little of a map I made but didn't finish either might help . Some of the dialog is from spearhead .
scene1:
$scene1trigger waittill trigger
$scene1trigger remove

level.friendly5 nodamage
level.friendly8 thread make_full_turn $player

level.friendly8 say dfr_scripted_M5L3_13f //"Lieutenant."

level.friendly4 runto friendly_call_way
level.friendly4 waittill movedone

level.friendly4 thread make_full_turn $player
level.friendly4 say dfr_scripted_M3L1_075k //"Powell, get down the line, the Captain's needs you!"
level.friendly4 waittill saydone

$player playsound warn_player_arty_cover //"TAKE COVER!"

$start_clip remove

$player playsound arty_leadin
wait 1

thread global/exploder.scr::explode 1

exec global/earthquake.scr 1.25 .3 0 1

level.friendly4 say snd_dfr_death_generic

level.friendly4 holster

level.friendly4 exec global/setdeathanim.scr death_mortar_flip

level.friendly4 takedamage

level.friendly4 thread bhit 100

WAIT .3

level.friendly8 turnto $friendly_call_way
level.friendly8 lookat $friendly_call_way
level.friendly8 runto $friendly_call_way

level.friendly8 waittill movedone


level.friendly8 turnto level.friendly4


wait 3

level.friendly8 say dfr_T2L3_AM4103

level.friendly8 waittill saydone

wait 1
level.friendly8 turnto $medic_move_spot

level.friendly8 lookat $medic_move_spot

level.friendly8 exec global/walkto.scr $medic_move_spot

level.friendly8 lookat null

end


bhit local.damage local.location local.direction local.force:

if (local.damage == NIL || local.damage == 0)
{ local.damage = 40
}

if (local.location == NIL)
{
local.location = 3
}
else if (local.location == -1)
{
local.temp = (randomint 17 + 1)
local.location = local.temp
}

if (local.direction == NIL || local.direction == 0)
{
local.direction = (0 -1 0)
}

if (local.force == NIL)
{
local.force = 15
}

//*** set the characters script_damage variable so the player doesn't lose the level
self.script_damage = 1

//*** damage the target
self exec global/bullethit.scr local.direction local.damage local.force local.location

self playsound snd_bh_flesh

self.script_damage = 0

end
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Post by cjrs »

nope...that didn't work. I pasted the exact top lines of yours, just changed the names. Nothing.

Here, take a look at this. Maybe it's something with Radiant or something...

Help page with screenshots and my script...
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

ok theres a few problems with your script.

for one thing, you have level.ally. whenever you create a level, local, game, group, etc object, you have to define it first. you can not just say "level.thisdudehere say hi" you have to define level.ally. whatever the targetname is for your soldier, it will be this in the script:

$myainame

sowhatever the targetname is, you can call him in script by putting a dollar sign in front of it. so if his targetname was bob, it would be:

$bob say hi

now you CAN make him a level.ally if you create the variable level.ally and store bob in there. like this:

level.ally = $bob

so now whenever you use level.ally, you are referring to bob


you have the line "level.ally thread make_full_turn $player" you are making level.ally start a thread named make_full_turn. that thread has to be in your script. you don't have a thread named make_full_turn in your script, so it does nothing. you can either copy that thread into your script, or execute it as it is. to execute it from another script, you would give the path. lets say i have a script named "justshootme" that script is in main/global folder. inside "justshootme", there is a thread named "shoot" that thread named shoot will make my aiguy shoot. so to use that thread, I would type this:

level.ally thread global/justshootme.scr::shoot

the directory starts in main, so i type in the path (global/justshootme.scr)

the :: tells me what thread to go to. in this case it's shoot. if the thread was 'hold', it would be ::hold

now i dont know if the say you make level.ally say is an alias or not. regardless, you have to use the ALIAS of a sound. look in ubersound/uberdialog.scr to find the dialog aliases. you'll have to extract it first (as im sure you know how).
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Post by cjrs »

Well, before I was using $ally but it didn't work anyway. And I also tried an alias (I believe it was allied_airborne_db) but it had never worked. I don't really care about him making a full turn, because he doesn't bother moving in the first place.

I could try the if, then, else method...but i've never done something like that before
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

can you send me the map and script? i want to look at it to see whats wrong.
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Post by cjrs »

mmmmkay. Do you have AIM/MSN or should I email it?
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Post by cjrs »

Wait. Don't answer that.

Code: Select all

thread trigger

fadein 2 0 0 0 1 
wait 2 
level.script = "maps/test_cjrs.scr" 

trigger:

$trigger_move waittill trigger
message "woot"
thread move

end


//FOOKIN YEA!

move:

if ($trigger_move)
{
	wait .5
	$ally runto $move_path
	wait 4
	$ally say allied_pilot_ca
	$ally waittill saydone
}

end
haaah! it worked! Thanks for all your help guys! I'll name some background extras after ya. hehe. not bad for a newbie enh? :)
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Instead of thread trigger you can set a key on the trigger it's self

key:setthread
value:move

when the trigger is triggered it will start the thread you don't need the trigger thread just the move thread
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Post by cjrs »

Thanks man, i'll keep that in mind.

So, if I have another question, be sure to look for updates to this topic...;)
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

Then this will become the new longest thread ever LOL! :lol:
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Post by cjrs »

Alcoholic wrote:Then this will become the new longest thread ever LOL! :lol:
LOL. Yeah probably. I know abit more then I let on though..hehe
Post Reply