Jump to content
Sign in to follow this  
KaRRiLLioN

Scripting command changes in resistance?

Recommended Posts

I've figured out that NearestObject is no longer operating the same way. Are there many other changes? I'd like to start fixing all of my missions so that when the general populace gets finally gets upgraded, I can have my missions working on the server. =)

Will an updated COMREF be posted soon?

Thanks, and the new island is a true work of art!

Share this post


Link to post
Share on other sites

Resistance won't arrive in my little corner of the world for sometime, how has nearestObject changed exactly?

Share this post


Link to post
Share on other sites

Well when I use it like _vcl=NearestObject [Obj,"type"]

then it says something to the effect of "Got object, expected number"

So I'm thinking that it may be looking for a distance from a unit or something extra instead. I haven't had a chance to play around with it yet though.

Share this post


Link to post
Share on other sites

Sounds promising, the limited range that nearestObject checked was it's biggest limitation.

Share this post


Link to post
Share on other sites

yay...

and

weapons command returns the players current weapon smile.gif

well i did this

Hint format ["%1",weapons player]

and i got AK74 CZ or AK47 CZ forgot what is what but anyway point is it works smile.gif

no more respawning with no ammo or anything!

respawning with weapons you died with

Share this post


Link to post
Share on other sites

Hello KaRRiLLion,

Last night, i've been looking once more into BIS open source

multiplayer missions, and i found an interresting thing.

Maybe you already know about that, however i would

like to tell it to you.

You can group static objects like houses (those, where

you hold your mouse cursor above and a name shows up)

or fuel stations, etc. (everything, where an object name

shows up) with triggers.

For example - create a trigger (range 10/10) type: none

activation: not present

Now group this trigger with let's say the fuel station in

St.Pierre SE on Everon. Place the trigger so that the fuel station is inside the trigger's area.

If you dbl-click the trigger, you will see that the type: none

changed into a type: StaticObject

As soon as you destroy this fuel station, the trigger becomes

active.

Or: same trigger same fuel station, but this time give the

trigger a name, and change the activation to: present

In any other trigger you can put this fuel station into a string: obj=list trigger_name select 0,

without using the nearest Object method.

If this is already old stuff for you, then let's say: my fault tounge.gif

~S~ CD

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (DV Chris Death @ July 05 2002,05:10)</td></tr><tr><td id="QUOTE">Hello KaRRiLLion,

Last night, i've been looking once more into BIS open source

multiplayer missions, and i found an interresting thing.

Maybe you already know about that, however i would

like to tell it to you.

You can group static objects like houses (those, where

you hold your mouse cursor above and a name shows up)

or fuel stations, etc. (everything, where an object name

shows up) with triggers.

For example - create a trigger (range 10/10) type: none

activation: not present

Now group this trigger with let's say the fuel station in

St.Pierre SE on Everon. Place the trigger so that the fuel station is inside the trigger's area.

If you dbl-click the trigger, you will see that the type: none

changed into a type: StaticObject

As soon as you destroy this fuel station, the trigger becomes

active.

Or: same trigger same fuel station, but this time give the

trigger a name, and change the activation to: present

In any other trigger you can put this fuel station into a string: obj=list trigger_name select 0,

without using the nearest Object method.

If this is already old stuff for you, then let's say: my fault tounge.gif

~S~ CD<span id='postcolor'>

This is amazing wow.gif Imagine the possibilites wow.gif

BIS ARE the gaming gods biggrin.gif

Share this post


Link to post
Share on other sites

Hmmm I cant get the thing to work with the respawn with weapons you died with....

Hint format ["%1",weapons player]

am i supposed to put this in a trigger or in the init field of the player???

would like to know that since me and my body am working on a mission where there's only guns...

so its kind of irritating to respawn with and m16 or ak74

regards [WKK]-Stealth

Share this post


Link to post
Share on other sites

Chris, that's a very good point, especially for using objects already placed. Here's a copy of what I posted on the OFPEC forums regarding how I'm trying to use NearestObject:

Argh this NearestObject change has SCREWED up some of my missions.

Sefe, I'm using some code that you helped me with for a vehicle respawn script, but I've altered it so that you can use it with the new way the NearestObject command works. With the old method it was much easier just to loop through some arrays, but for some reason now, the CountType doesn't seem to be working in this portion of the script that detects what kind of vehicle you're standing next to.

This script is used so that when you activate the action, it looks for a vehicle that is in front of you within 15 feet and then gives you the option to repair it. But for some reason even though it seems to detect the vehicle, it won't match it to the proper "type" string. Any ideas?

_unit is the player, _list1 would be like ["M1Abrams",50,500,"M60",30,200] where you have the type, the time it will take to repair and the cost to repair. BTW this portion of the script came from a building repair script, but it operates identically.

_unitpos=Getpos _unit

_unitdir=Getdir _unit

_dir=GetDir _actionunit

_buildingpos=[(_unitpos select 0) + ((sin _unitDir) * 15), (_unitpos select 1) + ((cos _unitDir) * 15),(_unitpos select 2)]

_building=NearestObject _buildingpos

_i = 0

#Loop

? (_i > (Count _list1)) : Goto "Skip"

_Buildingtype = _list1 Select _i

_typename = _list2 Select _i

_VehicleTypeDoesMatch = ((_Buildingtype CountType _this) == 1)

_msg=Format["%1,%2,%3,%4",_buildingtype,_typename,_building,_VehicleTypeDoesMatch]; Hint _msg

~1

? _VehicleTypeDoesMatch : _type = _Buildingtype

? _VehicleTypeDoesMatch : Goto "Found"

_i = _i + 3

Goto "Loop"

#Found

?(!Isnull _building):Goto "Continue"

Goto "Skip"

#Continue

?(_unit Distance _building<15):Goto "BuildingFound"

#Skip

_x=_x+3

?(_x>=_countlist):Hint "You must be within 15 feet of a Building to log in."; Goto "End"

Goto "SearchLoop"

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×